import { useState } from 'react'; import { router } from '@inertiajs/react'; import { AlertCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { useTranslation } from 'react-i18next'; export default function DeleteUser() { const { t } = useTranslation(); const [confirmingUserDeletion, setConfirmingUserDeletion] = useState(false); const confirmUserDeletion = () => { setConfirmingUserDeletion(true); }; const deleteUser = () => { router.delete(route('profile.destroy'), { preserveScroll: true, onSuccess: () => closeModal(), onError: () => closeModal(), onFinish: () => closeModal(), }); }; const closeModal = () => { setConfirmingUserDeletion(false); }; return (
{t("Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.")}