'use client'; import React, { useState } from 'react'; import { useRouter } from 'next/navigation'; import { deleteAccount } from '@/app/API/profile/updateProfile'; import './delete.scss'; const DeleteAccountPage = () => { const router = useRouter(); const [confirmText, setConfirmText] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (confirmText !== 'DELETE') { setError('Please type DELETE to confirm'); return; } setLoading(true); setError(null); try { await deleteAccount(); router.push('/profile/delete/success'); } catch (err: any) { setError(err.message || 'Failed to delete account'); setLoading(false); } }; return (

Delete Account

This action can be reversed within 30 days

{error && (
{error}
)}

Are you sure you want to delete your account?

Important: Your account will be scheduled for deletion and will be permanently removed after 30 days.
What happens when you delete your account:
  • Your profile and personal information will be scheduled for deletion
  • You can cancel the deletion within 30 days
  • After 30 days, all your data will be permanently deleted
  • You'll lose access to any purchases, order history, and saved items
setConfirmText(e.target.value)} required />
); }; export default DeleteAccountPage;