import { useT } from "@agent-native/core/client/i18n"; import { IconVideo, IconFolder, IconUsersGroup, IconArchive, IconTrash, IconPlayerRecord, } from "@tabler/icons-react"; import { useNavigate } from "react-router"; import { Button } from "@/components/ui/button"; type EmptyKind = | "library" | "shared" | "folder" | "space" | "archive" | "trash" | "search"; const ICONS: Record> = { library: IconVideo, shared: IconUsersGroup, folder: IconFolder, space: IconUsersGroup, archive: IconArchive, trash: IconTrash, search: IconVideo, }; const CTA_KINDS = new Set(["library", "folder", "space"]); interface EmptyStateProps { kind: EmptyKind; spaceId?: string | null; folderId?: string | null; onCtaClick?: () => void; } export function EmptyState({ kind, spaceId, folderId, onCtaClick, }: EmptyStateProps) { const navigate = useNavigate(); const t = useT(); const Icon = ICONS[kind]; const hasCta = CTA_KINDS.has(kind); const handleCta = () => { if (onCtaClick) { onCtaClick(); } else { const params = new URLSearchParams(); if (spaceId) params.set("spaceId", spaceId); if (folderId) params.set("folderId", folderId); const qs = params.toString(); navigate(qs ? `/record?${qs}` : "/record"); } }; return (

{t(`empty.${kind}.title`)}

{t(`empty.${kind}.body`)}

{hasCta && ( )}
); }