import { FileAudioIcon, FileStackIcon, ImageIcon } from "lucide-react"; import type { ComponentType } from "react"; import type { AttachmentLibraryTab } from "@/hooks/useAttachmentLibrary"; import { cn } from "@/lib/utils"; import { useTranslate } from "@/utils/i18n"; interface AttachmentLibraryEmptyStateProps { className?: string; tab: AttachmentLibraryTab; } const EMPTY_STATE_CONFIG: Record< AttachmentLibraryTab, { descriptionKey: "attachment-library.empty.audio" | "attachment-library.empty.documents" | "attachment-library.empty.media"; icon: ComponentType<{ className?: string }>; titleKey: "attachment-library.tabs.audio" | "attachment-library.tabs.documents" | "attachment-library.tabs.media"; } > = { audio: { descriptionKey: "attachment-library.empty.audio", icon: FileAudioIcon, titleKey: "attachment-library.tabs.audio", }, documents: { descriptionKey: "attachment-library.empty.documents", icon: FileStackIcon, titleKey: "attachment-library.tabs.documents", }, media: { descriptionKey: "attachment-library.empty.media", icon: ImageIcon, titleKey: "attachment-library.tabs.media", }, }; const AttachmentLibraryEmptyState = ({ className, tab }: AttachmentLibraryEmptyStateProps) => { const t = useTranslate(); const { descriptionKey, icon: Icon, titleKey } = EMPTY_STATE_CONFIG[tab]; return (
{t(titleKey)}

{t(descriptionKey)}

); }; export default AttachmentLibraryEmptyState;