/** * DecodeResultPaper * * FileMode 与 ImageMode 通用的 decode 结果展示组件。 * 提取了二者 decode 输出区完全一致的结构: * 标题 → 可选预览(children)→ 文件信息 → 文件名输入 → 下载按钮 * * FileMode 直接使用,ImageMode 通过 children 传入图片预览。 */ import { Download } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { formatBytes } from '@/utils/format'; interface DecodeResultPaperProps { /** 标题文案 */ title: string; /** 解码后推断的 MIME 类型 */ mimeType: string; /** 解码后 Blob 的大小(字节) */ blobSize: number; /** 当前文件名 */ fileName: string; /** 文件名变更回调 */ onFileNameChange: (name: string) => void; /** 下载按钮点击回调 */ onDownload: () => void; /** 可选的预览内容,ImageMode 用于渲染图片预览 */ children?: React.ReactNode; } export default function DecodeResultPaper({ title, mimeType, blobSize, fileName, onFileNameChange, onDownload, children, }: DecodeResultPaperProps) { return (