'use client'; import * as React from 'react'; import Badge from './Badge'; import FileTypeIcon from './FileTypeIcon'; import { KBFile } from '@/lib/kb-data'; interface UploadedFileCardProps { file: KBFile; onDelete: (id: string) => void; isDeleting?: boolean; } function Spinner({ className = '' }: { className?: string }) { return ( ); } // Per-type aurora glow colors that bleed up from the bottom of the card. const AURORA: Record = { PDF: { ['--aurora-1' as string]: 'rgba(244,63,94,0.55)', ['--aurora-2' as string]: 'rgba(249,115,22,0.45)' }, DOCX: { ['--aurora-1' as string]: 'rgba(59,130,246,0.55)', ['--aurora-2' as string]: 'rgba(34,211,238,0.45)' }, EXCEL: { ['--aurora-1' as string]: 'rgba(16,185,129,0.55)', ['--aurora-2' as string]: 'rgba(132,204,22,0.4)' }, CSV: { ['--aurora-1' as string]: 'rgba(168,85,247,0.55)', ['--aurora-2' as string]: 'rgba(99,102,241,0.45)' }, }; export default function UploadedFileCard({ file, onDelete, isDeleting = false }: UploadedFileCardProps) { // Brand logo for the file type, sitting on a subtle dark tile to match // the admin theme. const renderIcon = () => (
); const statusVariants: Record = { Ready: 'success', Processing: 'warning', Failed: 'danger', }; return (
{/* File Metainfo */}
{renderIcon()}

{file.name}

{file.size} • {file.type}
{/* Delete and Status */}
{isDeleting ? ( Removing… ) : ( <> {file.status} )}
); }