'use client' import { AlertCircle, Inbox, RotateCcw } from 'lucide-react' import { useEffect, useRef, type ReactNode } from 'react' import { Button } from '@/app/components/ui/button' import { Skeleton } from '@/app/components/ui/skeleton' import { cn } from '@/app/lib/utils' import { useT } from '@/app/lib/i18n/MessagesProvider' /** * The four required data states from DASHBOARD-STANDARD.md §8. Every data-bound * view uses these rather than inventing its own copy. */ export function EmptyState({ title, action, icon, className, }: { title: string /** The corrective action — "No data" without a way forward is not acceptable. */ action?: ReactNode icon?: ReactNode className?: string }) { return (

{title}

{action}
) } export function ErrorState({ message, onRetry, className, }: { message: string onRetry?: () => void className?: string }) { const t = useT() const ref = useRef(null) useEffect(() => { ref.current?.scrollIntoView?.({ block: 'nearest' }) }, [message]) return (
{onRetry && ( )}
) } export function TableSkeleton({ rows = 5, columns = 4 }: { rows?: number; columns?: number }) { const t = useT() return (
{t("UiLoading")} {Array.from({ length: rows }).map((_, r) => (
{Array.from({ length: columns }).map((__, c) => ( ))}
))}
) }