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"; interface Props { applicationId: string; } export const DeployApplication = ({ applicationId }: Props) => { const { data, refetch } = api.application.one.useQuery( { applicationId, }, { enabled: !!applicationId }, ); const { mutateAsync: deploy } = api.application.deploy.useMutation(); return ( Are you absolutely sure? This will deploy the application Cancel { toast.success("Deploying Application...."); await refetch(); await deploy({ applicationId, }).catch(() => { toast.error("Error to deploy Application"); }); await refetch(); }} > Confirm ); };