import { Attachment } from "@/types/proto/api/v1/attachment_service"; import { getAttachmentUrl } from "@/utils/attachment"; import ResourceIcon from "./ResourceIcon"; interface Props { resource: Attachment; className?: string; } const MemoResource: React.FC = (props: Props) => { const { className, resource } = props; const resourceUrl = getAttachmentUrl(resource); const handlePreviewBtnClick = () => { window.open(resourceUrl); }; return (
{resource.type.startsWith("audio") ? ( ) : ( <> {resource.filename} )}
); }; export default MemoResource;