import React from 'react';
import { View, ActivityIndicator, Text, StyleSheet } from 'react-native';
import { AppColors, FontSizes, Spacing } from '@/constants/theme';
interface LoadingSpinnerProps {
size?: 'small' | 'large';
color?: string;
message?: string;
fullScreen?: boolean;
}
export function LoadingSpinner({
size = 'large',
color = AppColors.primary,
message,
fullScreen = false,
}: LoadingSpinnerProps) {
const content = (
<>
{message && {message}}
>
);
if (fullScreen) {
return {content};
}
return {content};
}
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
padding: Spacing.lg,
},
fullScreen: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: AppColors.background,
},
message: {
marginTop: Spacing.md,
fontSize: FontSizes.base,
color: AppColors.textSecondary,
textAlign: 'center',
},
});