feat : update
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import { SimpleTooltip } from "@/components/tooltip";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -25,6 +26,7 @@ interface DeleteConfirmationDialogProps {
|
||||
open?: ComponentProps<typeof AlertDialog>["open"];
|
||||
onOpenChange?: ComponentProps<typeof AlertDialog>["onOpenChange"];
|
||||
showSuccessToast?: boolean;
|
||||
triggerTooltip?: ReactNode;
|
||||
}
|
||||
|
||||
export function DeleteConfirmationDialog({
|
||||
@@ -37,6 +39,7 @@ export function DeleteConfirmationDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
showSuccessToast = true,
|
||||
triggerTooltip,
|
||||
}: DeleteConfirmationDialogProps) {
|
||||
const handleConfirm = async () => {
|
||||
await onConfirm();
|
||||
@@ -46,7 +49,13 @@ export function DeleteConfirmationDialog({
|
||||
return (
|
||||
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
||||
{trigger ? (
|
||||
<AlertDialogTrigger render={trigger}>{children}</AlertDialogTrigger>
|
||||
triggerTooltip ? (
|
||||
<SimpleTooltip text={triggerTooltip}>
|
||||
<AlertDialogTrigger render={trigger}>{children}</AlertDialogTrigger>
|
||||
</SimpleTooltip>
|
||||
) : (
|
||||
<AlertDialogTrigger render={trigger}>{children}</AlertDialogTrigger>
|
||||
)
|
||||
) : null}
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
|
||||
Reference in New Issue
Block a user