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