import React from "react"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { api } from "@/utils/api"; import { RefreshCcw } from "lucide-react"; import { toast } from "sonner"; interface Props { applicationId: string; } export const RefreshToken = ({ applicationId }: Props) => { const { mutateAsync } = api.application.refreshToken.useMutation(); const utils = api.useUtils(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the domain Cancel { await mutateAsync({ applicationId, }) .then(() => { utils.application.one.invalidate({ applicationId, }); toast.success("Refresh updated"); }) .catch(() => { toast.error("Error to update the refresh token"); }); }} > Confirm ); };