import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { confirmable, createConfirmation } from 'react-confirm';
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './alert-dialog.js';
const ConfirmDialog = ({ show, proceed, title, description, confirmLabel = 'Continue', cancelLabel = 'Cancel', confirmVariant = 'default', cancelVariant = 'secondary', }) => {
    return (_jsx(AlertDialog, { open: show, children: _jsxs(AlertDialogContent, { className: show ? 'animate-in' : 'animate-out', onOpenAutoFocus: (e) => {
                e.preventDefault();
            }, children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: title }), _jsx(AlertDialogDescription, { children: description })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { variant: cancelVariant, onClick: () => {
                                proceed(false);
                            }, children: cancelLabel }), _jsx(AlertDialogAction, { autoFocus: true, variant: confirmVariant, onClick: () => {
                                proceed(true);
                            }, children: confirmLabel })] })] }) }));
};
export const confirm = createConfirmation(confirmable(ConfirmDialog));
//# sourceMappingURL=confirm.js.map