function formatBytes(bytes) { if (!bytes) return "0 B"; const units = ["B", "KB", "MB", "GB"]; const i = Math.floor(Math.log(bytes) / Math.log(1024)); return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${units[i]}`; } export default function ImagePreview({ file, previewUrl, onClear, disabled }) { if (!file || !previewUrl) return null; return (
{file.name}

{file.name}

{formatBytes(file.size)} ยท{" "} {file.type.replace("image/", "").toUpperCase()}

); }