import { Download } from "lucide-react"; import type { Attachment, Post } from "../../../types/post"; import { fileIcon } from "../utils/fileIcon"; import { formatBytes } from "../utils/formatBytes"; function AttachmentRow({ att }: { att: Attachment }) { const isImageAsDoc = att.mime.startsWith("image/"); const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename }); return (
{isImageAsDoc && att.thumbnailUrl ? ( <>
) : (
)}
{att.filename}
{formatBytes(att.sizeBytes)}
); } export function FileDocBubble({ post }: { post: Post }) { return (
{post.attachments.map((att) => ( ))} {post.text ? (
{post.text}
) : null}
); }