import { useRef, useState } from "react"; import { Form, useTransition } from "@remix-run/react"; import clsx from "clsx"; import Button from "../button"; import SettingsSection from "../settings-section"; import Modal, { ModalTitle } from "~/features/core/components/modal"; export default function DangerZone() { const transition = useTransition(); const isCurrentFormTransition = transition.submission?.formData.get("_action") === "deleteUser"; const isDeletingUser = isCurrentFormTransition && transition.state === "submitting"; const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false); const modalCancelButtonRef = useRef(null); const closeModal = () => { if (isDeletingUser) { return; } setIsConfirmationModalOpen(false); }; 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.

); }