import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController'; import HeadingSmall from '@/components/heading-small'; import InputError from '@/components/input-error'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { Button } from '@/components/ui/button'; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { type SharedData } from '@/types'; import { __ } from '@/utils/i18n'; import { Form, usePage } from '@inertiajs/react'; import { InfoIcon } from 'lucide-react'; import { useRef } from 'react'; export default function DeleteUser() { const { auth } = usePage().props; const isDemoAccount = auth?.isDemoAccount ?? false; const passwordInput = useRef(null); if (isDemoAccount) { return (
{__('The demo account cannot be deleted.')}
); } return (

{__('Warning')}

{__( 'Please proceed with caution, this cannot be undone.', )}

{__( 'Are you sure you want to delete your account?', )} {__( 'Once your account is deleted, all of its resources\n and data will also be permanently deleted. Please\n enter your password to confirm you would like to\n permanently delete your account.', )}
passwordInput.current?.focus()} resetOnSuccess className="space-y-6" > {({ resetAndClearErrors, processing, errors }) => ( <>
)}
); }