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