import React from 'react'; import type { MessageBlock } from '@/store/commStore'; import { Download, FileText } from 'lucide-react'; interface FileBlockProps { block: MessageBlock; } function formatFileSize(bytes: number | undefined): string { if (typeof bytes !== 'number' || bytes <= 0) return ''; if (bytes < 1024) return `${bytes} B`; if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`; } const fileIcon = (