diff --git a/web/src/components/MemoView/components/metadata/AttachmentList.tsx b/web/src/components/MemoView/components/metadata/AttachmentList.tsx index 522072790..7783725fc 100644 --- a/web/src/components/MemoView/components/metadata/AttachmentList.tsx +++ b/web/src/components/MemoView/components/metadata/AttachmentList.tsx @@ -1,15 +1,17 @@ +import { FileIcon, PaperclipIcon } from "lucide-react"; import { useState } from "react"; import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb"; import { getAttachmentType, getAttachmentUrl } from "@/utils/attachment"; -import MemoAttachment from "../../../MemoAttachment"; +import { formatFileSize, getFileTypeLabel } from "@/utils/format"; import PreviewImageDialog from "../../../PreviewImageDialog"; import AttachmentCard from "./AttachmentCard"; +import SectionHeader from "./SectionHeader"; interface AttachmentListProps { attachments: Attachment[]; } -function separateMediaAndDocs(attachments: Attachment[]): { media: Attachment[]; docs: Attachment[] } { +const separateMediaAndDocs = (attachments: Attachment[]): { media: Attachment[]; docs: Attachment[] } => { const media: Attachment[] = []; const docs: Attachment[] = []; @@ -23,7 +25,70 @@ function separateMediaAndDocs(attachments: Attachment[]): { media: Attachment[]; } return { media, docs }; -} +}; + +const DocumentItem = ({ attachment }: { attachment: Attachment }) => { + const fileTypeLabel = getFileTypeLabel(attachment.type); + const fileSizeLabel = attachment.size ? formatFileSize(Number(attachment.size)) : undefined; + + return ( +