import { useRef, useState } from "react"; import { useMutation } from "blitz"; import clsx from "clsx"; import Button from "./button"; import SettingsSection from "./settings-section"; import Modal, { ModalTitle } from "./modal"; import deleteUser from "../mutations/delete-user"; export default function DangerZone() { const deleteUserMutation = useMutation(deleteUser)[0]; const [isDeletingUser, setIsDeletingUser] = useState(false); const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false); const modalCancelButtonRef = useRef(null); const closeModal = () => { if (isDeletingUser) { return; } setIsConfirmationModalOpen(false); }; const onConfirm = () => { setIsDeletingUser(true); return deleteUserMutation(); }; return (

Once you delete your account, all of its data will be permanently deleted and any ongoing subscription will be cancelled.

Delete my account

Are you sure you want to delete your account? Your subscription will be cancelled and your data permanently deleted.

You are free to create a new account with the same email address if you ever wish to come back.

); }