mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 21:41:16 +00:00
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import {
|
|
FileArchiveIcon,
|
|
FileAudioIcon,
|
|
FileIcon,
|
|
FileImageIcon,
|
|
FileSpreadsheetIcon,
|
|
FileTextIcon,
|
|
FileVideoIcon,
|
|
PresentationIcon,
|
|
type LucideIcon,
|
|
} from "lucide-react";
|
|
import { cn } from "cn";
|
|
import type { FileKind } from "@/modules/shared/schemas/documents";
|
|
|
|
const ICONS: Record<FileKind, { icon: LucideIcon; className: string }> = {
|
|
image: { icon: FileImageIcon, className: "text-violet-500" },
|
|
pdf: { icon: FileTextIcon, className: "text-red-500" },
|
|
text: { icon: FileTextIcon, className: "text-ink-500" },
|
|
document: { icon: FileTextIcon, className: "text-blue-500" },
|
|
spreadsheet: { icon: FileSpreadsheetIcon, className: "text-emerald-600" },
|
|
presentation: { icon: PresentationIcon, className: "text-orange-500" },
|
|
archive: { icon: FileArchiveIcon, className: "text-amber-600" },
|
|
video: { icon: FileVideoIcon, className: "text-pink-500" },
|
|
audio: { icon: FileAudioIcon, className: "text-cyan-600" },
|
|
other: { icon: FileIcon, className: "text-ink-500" },
|
|
};
|
|
|
|
export function FileKindIcon({ kind, className }: { kind: FileKind; className?: string }) {
|
|
const { icon: Icon, className: color } = ICONS[kind];
|
|
return <Icon className={cn(color, className)} aria-hidden />;
|
|
}
|