Files
initiative/apps/web/src/components/import-confirm-prompt.tsx
Lukas 209df13c32 Add export method dialog, extract shared Dialog primitive
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>
2026-03-27 14:57:31 +01:00

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>
);
}