import React, { useState } from 'react'; import { Box, Button, Text } from '@mantine/core'; import DeleteAccountModal from '../../modals/account/DeleteAccountModal'; import { useAuth } from '../../../contexts/AuthContext'; import { useProfileSettings } from '../../../hooks/useProfileSettings'; const DangerZoneSettings: React.FC = () => { const { logout } = useAuth(); const { deleteAccount } = useProfileSettings(); const [deleteModalOpened, setDeleteModalOpened] = useState(false); const handleDelete = async (password: string): Promise => { const success = await deleteAccount(password); if (success) { setDeleteModalOpened(false); await logout(); } }; return ( Once you delete your account, there is no going back. Please be certain. setDeleteModalOpened(false)} onConfirm={handleDelete} /> ); }; export default DangerZoneSettings;