import { FileIcon } from '@renderer/components/team/editor/FileIcon'; import { formatFileSize, isImageMime } from '@renderer/utils/attachmentUtils'; import { Ban, X } from 'lucide-react'; import { AttachmentThumbnail } from './AttachmentThumbnail'; import type { AttachmentPayload } from '@shared/types'; interface AttachmentPreviewItemProps { attachment: AttachmentPayload; onRemove: (id: string) => void; onPreview?: () => void; disabled?: boolean; } export const AttachmentPreviewItem = ({ attachment, onRemove, onPreview, disabled, }: AttachmentPreviewItemProps): React.JSX.Element => { const isImage = isImageMime(attachment.mimeType); const dataUrl = isImage ? `data:${attachment.mimeType};base64,${attachment.data}` : undefined; return (