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