import { Download, FileText, Share2 } from 'lucide-react'; import type { ToolCallView } from '@/lib/types'; import { downloadFile, shareFile } from '@/lib/api'; import { Button } from '@/components/ui/button'; export function DocxCard({ call }: { call: ToolCallView }) { const p = call.payload as { title?: string; filename?: string; file_id?: string; words?: number; outline?: string[] }; const fileId = p.file_id || call.artifacts?.[0]?.file_id; const filename = p.filename || 'document.docx'; return (
{p.title || filename}
{filename}{p.words ? ` · ${p.words} mots` : ''} · Word (.docx)
{p.outline?.length ? (
    {p.outline.map((h, i) =>
  1. {h}
  2. )}
) : null} {fileId && (
{typeof navigator !== 'undefined' && !!navigator.share && }
)}
); }