import { FC } from 'react'; import { ButtonProps } from '../ui/atoms/Button'; import { IconProps } from '../ui/atoms/Icon'; interface ConfirmDialogConfirmProps { /** Label for the confirm button */ label: string; /** Button variant. Use `"danger"` for destructive actions and `"primary"` for generic confirmations. */ variant?: ButtonProps["variant"]; /** Async action to execute on confirm */ onClick: () => Promise; } interface ConfirmDialogProps { /** Controls visibility of the dialog */ show: boolean; /** Called when the dialog should close */ onClose: () => void; /** Icon name to display at the top of the dialog (from the Icon component set) */ icon: IconProps["name"]; /** Main title shown in the dialog body. */ title: string; /** Optional extra content rendered below the title. */ description?: React.ReactNode; /** Configuration for the confirm (primary action) button */ confirm: ConfirmDialogConfirmProps; /** Optional label for the cancel button - Default "Cancel" */ cancelLabel?: string; /** * Message shown in the error toast when `confirm.onClick` rejects and overrides the API errors. */ errorMessage?: string; /** Optional success message shown when the action completes successfully */ successMessage?: string; /** * Toast variant used for the success message. Defaults to `"default"`. */ successVariant?: "default" | "success" | "error"; } type ConfirmDialogRendererProps = Omit; interface ConfirmDialogHook { /** * Opens the dialog. */ show: () => void; /** * The dialog renderer. Mount it in your component tree and pass it the * `icon`, `title`, `description`, `confirm` (and optional `errorMessage`) props. * Visibility is fully managed by the hook — you only need to call `show()`. * * @example * const { show, ConfirmDialog } = useConfirmDialog() * * return ( * <> * * * * ) */ ConfirmDialog: FC; } export declare function useConfirmDialog(): ConfirmDialogHook; export {};