Add minimal LoadingState component for displaying loading states across the app. Includes ActivityIndicator, optional message text, theme support, and comprehensive test coverage. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
545 B
TypeScript
18 lines
545 B
TypeScript
import React from 'react'
|
|
import { View, ActivityIndicator, ViewProps } from 'react-native'
|
|
import Text from './ui/Text'
|
|
|
|
interface LoadingStateProps extends ViewProps {
|
|
message?: string
|
|
color?: string
|
|
}
|
|
|
|
export default function LoadingState({ message, color = '#F5F5F5', testID, ...props }: LoadingStateProps) {
|
|
return (
|
|
<View testID={testID} className="flex-1 items-center justify-center" {...props}>
|
|
<ActivityIndicator size="large" color={color} />
|
|
{message && <Text className="mt-4">{message}</Text>}
|
|
</View>
|
|
)
|
|
}
|