cockpit-plugin-base-react - v1.1.1
    Preparing search index...

    Interface ConfirmActionState

    State and controls returned by useConfirmAction.

    interface ConfirmActionState {
        cancel: () => void;
        clearError: () => void;
        confirm: () => void;
        error: string | null;
        step: ConfirmStep;
        submit: (action: () => Promise<void>) => Promise<void>;
    }
    Index

    Properties

    cancel: () => void

    Transitions back to idle and clears the error.

    clearError: () => void

    Clears the error without changing the step.

    confirm: () => void

    Transitions from idleconfirming, opening the dialog.

    error: string | null

    Error message from the last failed submit, or null.

    Current phase of the flow.

    submit: (action: () => Promise<void>) => Promise<void>

    Runs action while in the submitting phase. On success transitions to idle; on failure stays in confirming with error set.