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 { toast } from "sonner"; export const Disable2FA = () => { const utils = api.useUtils(); const { mutateAsync, isLoading } = api.auth.disable2FA.useMutation(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the 2FA Cancel { await mutateAsync() .then(() => { utils.auth.get.invalidate(); toast.success("2FA Disabled"); }) .catch(() => { toast.error("Error to disable 2FA"); }); }} > Confirm ); };