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 { composeId: string; } export const RefreshTokenCompose = ({ composeId }: Props) => { const { mutateAsync } = api.compose.refreshToken.useMutation(); const utils = api.useUtils(); return ( Are you absolutely sure? This action cannot be undone. This will permanently change the token and all the previous tokens will be invalidated Cancel { await mutateAsync({ composeId, }) .then(() => { utils.compose.one.invalidate({ composeId, }); toast.success("Refresh Token updated"); }) .catch(() => { toast.error("Error to update the refresh token"); }); }} > Confirm ); };