runloopable / web /src /sheet /ExportDialog.tsx
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
816fa8a verified
Raw History Blame Contribute Delete
838 Bytes
import "../styles/sdlc73/sheet.css";
/** The ribbon owns the overlay and the captured download. */
export default function ExportDialog({ losses, label, busy, onBack, onDownload }: {
losses: string[]; label: string; busy: boolean; onBack: () => void; onDownload: () => void;
}) {
if (!losses.length) return null;
return <div className="sheet-export-review">
<button type="button" className="sheet-ribbon-item" disabled={busy} onClick={onBack}>Back</button>
<div className="sheet-export-losses" data-testid="sheet-export-losses" role="note" aria-label="Export changes">
<strong>Export changes</strong>
<ul>{losses.map(loss => <li key={loss}>{loss}</li>)}</ul>
</div>
<button type="button" className="sheet-ribbon-item" autoFocus disabled={busy} onClick={onDownload}>Download {label}</button>
</div>;
}