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 { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { postgresId: string; } export const StartPostgres = ({ postgresId }: Props) => { const { mutateAsync, isLoading } = api.postgres.start.useMutation(); const utils = api.useUtils(); return ( Are you sure to start the database? This will start the database Cancel { await mutateAsync({ postgresId, }) .then(async () => { await utils.postgres.one.invalidate({ postgresId, }); toast.success("Database started succesfully"); }) .catch(() => { toast.error("Error to start the Database"); }); }} > Confirm ); };