MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / ErrorState

Function ErrorState

frontend/src/components/commonUI/ErrorState.tsx:5–23  ·  view source on GitHub ↗
({ error, onRetry }: { error?: Error; onRetry?: () => void })

Source from the content-addressed store, hash-verified

3import { useTranslation } from 'react-i18next'
4
5function ErrorState({ error, onRetry }: { error?: Error; onRetry?: () => void }) {
6 const { t } = useTranslation()
7 const navigate = useNavigate()
8
9 return (
10 <VStack gap={4} p={8} textAlign="center">
11 <Text color="red.500" fontSize="lg">
12 {error?.message || 'Something went wrong'}
13 </Text>
14 {onRetry ? (
15 <Button onClick={onRetry}>{t('general.errors.tryAgain')}</Button>
16 ) : (
17 <Button onClick={() => navigate({ to: '/collections' })}>
18 {t('general.actions.goHome')}
19 </Button>
20 )}
21 </VStack>
22 )
23}
24
25export default ErrorState

Callers

nothing calls this directly

Calls 1

tFunction · 0.85

Tested by

no test coverage detected