import type { ReactNode } from 'react' import { AlertTriangle, type LucideIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, } from '@/components/ui/empty' import { FadeIn } from '@/components/page-transition' interface ErrorStateProps { icon?: LucideIcon title?: string description?: string onRetry?: () => void action?: ReactNode className?: string } export function ErrorState(props: ErrorStateProps) { const { t } = useTranslation() const Icon = props.icon ?? AlertTriangle return ( {props.title ?? t('Oops! Something went wrong')} {props.description != null && ( {props.description} )} {props.onRetry != null && ( )} {props.action} ) }