import React from 'react'; import { DocumentIcon } from './icons/DocumentIcon'; interface ProofPreviewProps { file?: File | null; previewUrl: string | null; fileName?: string; } export const ProofPreview: React.FC = ({ file, previewUrl, fileName }) => { if (!previewUrl) { return null; } const getMimeType = (): string => { if (file?.type) return file.type; if (previewUrl.startsWith('data:')) { const match = previewUrl.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+);/); if (match && match[1]) { return match[1]; } } return 'application/octet-stream'; // Fallback }; const fileType = getMimeType(); const displayName = fileName || file?.name || 'Proof Preview'; const renderPreview = () => { if (fileType.startsWith('image/')) { return ( {displayName} ); } if (fileType === 'video/mp4') { return ( ); } if (fileType === 'application/pdf') { return (