import { Attachment } from "@/types/proto/api/v1/attachment_service_pb"; import { getAttachmentUrl, isMidiFile } from "@/utils/attachment"; import AttachmentIcon from "./AttachmentIcon"; interface Props { attachment: Attachment; className?: string; } const MemoAttachment: React.FC = (props: Props) => { const { className, attachment } = props; const attachmentUrl = getAttachmentUrl(attachment); const handlePreviewBtnClick = () => { window.open(attachmentUrl); }; return (
{attachment.type.startsWith("audio") && !isMidiFile(attachment.type) ? ( ) : ( <> {attachment.filename} )}
); }; export default MemoAttachment;