export interface RawReprocessFailure { name: string; error: string; } export interface RawReprocessJob { running: boolean; /** Files attempted so far, including failures. */ done: number; total: number; current: string; eventName?: string; failures: RawReprocessFailure[]; cancelled?: boolean; } interface Props { job: RawReprocessJob; onCancel: () => void; onClose: () => void; } /** * Progress and summary for a RAW re-decode run. The job keeps running while the * dialog is open; Cancel stops it after the file already in flight. */ export default function RawReprocessModal({ job, onCancel, onClose }: Props) { const succeeded = Math.max(0, job.done - job.failures.length); const pct = job.total ? Math.round((job.done / job.total) * 100) : 0; const scope = job.eventName ? `“${job.eventName}”` : 'the selection'; return (
e.target === e.currentTarget && !job.running && onClose()} >

{job.running ? 'Reprocessing RAW files' : 'RAW reprocess summary'}

{job.total} RAW file{job.total === 1 ? '' : 's'} from {scope}. Existing edits and crops are kept.

{!job.running && ( )}

{job.running ? job.cancelled ? `Stopping after the current file · ${job.done} of ${job.total}` : `${job.done} of ${job.total}${job.current ? ` · ${job.current}` : '…'}` : job.cancelled ? `Stopped after ${job.done} of ${job.total}. Reprocessed ${succeeded}.` : `Reprocessed ${succeeded} of ${job.total}.`}

{!job.running && job.failures.length > 0 && (
{job.failures.length} file{job.failures.length === 1 ? '' : 's'} failed
    {job.failures.slice(0, 12).map((failure) => (
  • {failure.name}: {failure.error}
  • ))}
{job.failures.length > 12 && (

And {job.failures.length - 12} more…

)}
)}
); }