import { useEffect } from 'react' import clsx from 'clsx' interface ConfirmDialogProps { isOpen: boolean title: string message: React.ReactNode confirmLabel?: string cancelLabel?: string /** When true, the confirm button uses the destructive accent. */ destructive?: boolean onConfirm: () => void onClose: () => void } /** * Tiny modal-confirmation dialog. Mirrors the AddSourceFolderDialog overlay * pattern (custom fixed inset-0 backdrop, no shadcn Dialog dep). Esc closes. */ export function ConfirmDialog({ isOpen, title, message, confirmLabel = 'Confirm', cancelLabel = 'Cancel', destructive = false, onConfirm, onClose, }: ConfirmDialogProps) { // Esc to close. useEffect(() => { if (!isOpen) return const handler = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose() } window.addEventListener('keydown', handler) return () => window.removeEventListener('keydown', handler) }, [isOpen, onClose]) if (!isOpen) return null return (

{title}

{message}
) }