File size: 838 Bytes
816fa8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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>;
}