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 { Ban } from "lucide-react"; import { toast } from "sonner"; interface Props { mysqlId: string; } export const StopMysql = ({ mysqlId }: Props) => { const { mutateAsync, isLoading } = api.mysql.stop.useMutation(); const utils = api.useUtils(); return ( Are you absolutely sure to stop the database? This will stop the database Cancel { await mutateAsync({ mysqlId, }) .then(async () => { await utils.mysql.one.invalidate({ mysqlId, }); toast.success("Application stopped succesfully"); }) .catch(() => { toast.error("Error to stop the Application"); }); }} > Confirm ); };