Add export dialog with download/clipboard options and optional undo/redo history inclusion (default off). Extract shared Dialog component to ui/dialog.tsx, consolidating open/close lifecycle, backdrop click, and escape key handling from all 6 dialog components. Update spec to reflect export method dialog and optional history. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
840 B
TypeScript
33 lines
840 B
TypeScript
import { Button } from "./ui/button.js";
|
|
import { Dialog } from "./ui/dialog.js";
|
|
|
|
interface ImportConfirmDialogProps {
|
|
open: boolean;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
export function ImportConfirmDialog({
|
|
open,
|
|
onConfirm,
|
|
onCancel,
|
|
}: Readonly<ImportConfirmDialogProps>) {
|
|
return (
|
|
<Dialog open={open} onClose={onCancel}>
|
|
<h2 className="mb-2 font-semibold text-lg">Replace current encounter?</h2>
|
|
<p className="mb-4 text-muted-foreground text-sm">
|
|
Importing will replace your current encounter, undo/redo history, and
|
|
player characters. This cannot be undone.
|
|
</p>
|
|
<div className="flex justify-end gap-2">
|
|
<Button type="button" variant="ghost" onClick={onCancel}>
|
|
Cancel
|
|
</Button>
|
|
<Button type="button" onClick={onConfirm}>
|
|
Import
|
|
</Button>
|
|
</div>
|
|
</Dialog>
|
|
);
|
|
}
|