import React from 'react'; import type { Attachment } from '@backspace/shared'; import { useUIStore } from '../../stores/uiStore'; import { useTransferStore } from '../../stores/transferStore'; import { Tooltip } from '../ui/Tooltip'; interface AttachmentRendererProps { attachment: Attachment; } function formatFileSize(bytes: number): string { if (bytes < 1024) return `${bytes} B`; if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`; return `${(bytes / 1048576).toFixed(1)} MB`; } /** * Resolves the displayable URL for an attachment. Same logic used by inline * ``/`