import { Download, FileSpreadsheet, FileText, Image as ImageIcon, Share2 } from 'lucide-react'; import type { Artifact } from '@/lib/types'; import { downloadFile, shareFile } from '@/lib/api'; const icon = (t: string) => (t === 'xlsx' ? FileSpreadsheet : t === 'image' ? ImageIcon : FileText); const label = (t: string) => (t === 'xlsx' ? 'Excel' : t === 'docx' ? 'Word' : t === 'csv' ? 'CSV' : t === 'image' ? 'Image' : 'Fichier'); export function ArtifactChips({ artifacts }: { artifacts?: Artifact[] }) { const list = (artifacts || []).filter((a) => a.file_id && a.type !== 'quiz' && a.type !== 'sources'); if (!list.length) return null; const canShare = typeof navigator !== 'undefined' && !!navigator.share; return (