import React from 'react'
import { ActivityIndicator, StyleSheet, View } from 'react-native'
import { Text } from '../Text'
import { useTranslation } from 'react-i18next'
import { theme, fontSize, spacing } from '../../utils/theme'
export const EmptyPlaceholder: React.FC<{ text?: string }> = ({ text }) => {
const { t } = useTranslation()
return (
💬
{text ?? t('common.empty')}
)
}
export const LoadingPlaceholder: React.FC<{ text?: string }> = ({ text }) => {
const { t } = useTranslation()
return (
{text ?? t('common.loading')}
)
}
export const LoadErrorPlaceholder: React.FC<{
text?: string
onRetry?: () => void
}> = ({ text, onRetry }) => {
const { t } = useTranslation()
return (
⚠️
{text ?? t('toast.networkError')}
{onRetry && (
{t('common.retry')}
)}
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: spacing.xl,
},
icon: {
fontSize: 64,
marginBottom: spacing.md,
},
text: {
fontSize: fontSize.md,
color: theme.textTertiary,
textAlign: 'center',
},
retry: {
marginTop: spacing.lg,
fontSize: fontSize.md,
color: theme.primary,
textDecorationLine: 'underline',
},
})