import React from 'react'; import { TrashIcon, ArrowDownTrayIcon, EyeIcon, } from '@heroicons/react/24/outline'; import { Attachment } from '../../entities/Attachment'; import { formatFileSize, canPreviewInline, } from '../../utils/attachmentsService'; import FileIcon from './Icons/FileIcon'; interface AttachmentListItemProps { attachment: Attachment; onDelete: (attachment: Attachment) => void; onDownload: (attachment: Attachment) => void; onPreview?: (attachment: Attachment) => void; showPreview?: boolean; } const AttachmentListItem: React.FC = ({ attachment, onDelete, onDownload, onPreview, showPreview = true, }) => { const canPreview = canPreviewInline(attachment.mime_type); return (

{attachment.original_filename}

{formatFileSize(attachment.file_size)}

{showPreview && canPreview && onPreview && ( )}
); }; export default AttachmentListItem;