import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; import React from "react"; import { toast } from "sonner"; interface Props { notificationId: string; } export const DeleteNotification = ({ notificationId }: Props) => { const { mutateAsync, isLoading } = api.notification.remove.useMutation(); const utils = api.useUtils(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the notification Cancel { await mutateAsync({ notificationId, }) .then(() => { utils.notification.all.invalidate(); toast.success("Notification delete succesfully"); }) .catch(() => { toast.error("Error to delete notification"); }); }} > Confirm ); };