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 { useRouter } from "next/router"; import { toast } from "sonner"; interface Props { composeId: string; } export const DeleteCompose = ({ composeId }: Props) => { const { mutateAsync, isLoading } = api.compose.delete.useMutation(); const { push } = useRouter(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the compose and all its services. Cancel { await mutateAsync({ composeId, }) .then((data) => { push(`/dashboard/project/${data?.projectId}`); toast.success("Compose delete succesfully"); }) .catch(() => { toast.error("Error to delete the compose"); }); }} > Confirm ); };