dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
27 lines • 974 B
TypeScript
import { AlertDialogProps } from '@radix-ui/react-alert-dialog';
import { JSX, ReactNode } from 'react';
/**
* Props for the Confirm component.
*/
export type ConfirmProps = AlertDialogProps & {
/** The content to trigger the dialog (optional). */
children?: ReactNode;
/** Custom title for the dialog. */
title?: ReactNode;
/** Custom description for the dialog. */
description?: ReactNode;
/** Callback function when the confirm action is triggered. */
onConfirm: () => void;
};
/**
* Confirm renders a confirmation dialog and calls onConfirm when user confirms.
*
* @param title
* @param description
* @param children
* @param onConfirm
* @param props - Radix AlertDialog props plus content and onConfirm callback.
* @returns {JSX.Element} A confirmation dialog component
*/
export declare const Confirm: ({ title, description, children, onConfirm, ...props }: ConfirmProps) => JSX.Element;
//# sourceMappingURL=Confirm.d.ts.map