import { useState } from 'react' import { AlertTriangle } from 'lucide-react' export type ConfirmOptions = { title?: string message: string confirmText?: string cancelText?: string danger?: boolean checkboxLabel?: string checkboxDefaultChecked?: boolean } export type ConfirmResult = { confirmed: boolean checked: boolean } export function ConfirmDialog({ options, onClose, }: { options: ConfirmOptions onClose: (value: ConfirmResult) => void }) { const danger = options.danger ?? true const hasCheckbox = Boolean(options.checkboxLabel) const [checked, setChecked] = useState(Boolean(options.checkboxDefaultChecked)) return (
{options.message}
{hasCheckbox ? ( ) : null}