"use client" import { File, HardDrive, Image as ImageIcon } from "lucide-react" import { toast } from "sonner" import type { EmailAttachment } from "@/lib/email-data" import { mailAttachmentPreviewable, openMailAttachmentsPreview, } from "@/lib/mail/mail-attachment-preview" export function ListAttachmentChip({ att, messageId, attachments, attachmentIndex, }: { att: EmailAttachment messageId: string attachments: EmailAttachment[] attachmentIndex: number }) { const onClick = (e: React.MouseEvent) => { e.preventDefault() e.stopPropagation() if (!att.id) { toast.message("Pièce jointe non disponible") return } if (!mailAttachmentPreviewable(att)) { toast.message("Aperçu non disponible") return } openMailAttachmentsPreview(messageId, attachments, attachmentIndex) } return ( ) }