35 lines
855 B
TypeScript
35 lines
855 B
TypeScript
import React from 'react';
|
|
import { View, ActivityIndicator, Text } from 'react-native';
|
|
|
|
interface LoadingSpinnerProps {
|
|
message?: string;
|
|
fullScreen?: boolean;
|
|
size?: 'small' | 'large';
|
|
}
|
|
|
|
export const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({
|
|
message,
|
|
fullScreen = false,
|
|
size = 'large',
|
|
}) => {
|
|
if (fullScreen) {
|
|
return (
|
|
<View className="flex-1 items-center justify-center bg-gray-50">
|
|
<ActivityIndicator size={size} color="#2563EB" />
|
|
{message && (
|
|
<Text className="mt-3 text-gray-500 text-sm">{message}</Text>
|
|
)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<View className="items-center justify-center py-8">
|
|
<ActivityIndicator size={size} color="#2563EB" />
|
|
{message && (
|
|
<Text className="mt-2 text-gray-500 text-sm">{message}</Text>
|
|
)}
|
|
</View>
|
|
);
|
|
};
|