import { sni } from '@/services/network' import { Container, Box, Typography, Alert, Collapse, Button } from '@mui/material' import { useRouter } from 'next/router' import { useState } from 'react' import ErrorIcon from '@mui/icons-material/Error' export default function AccountDeletion() { const router = useRouter() const [error, setError] = useState(null) const [busy, setBusy] = useState(false) async function confirm() { try { setBusy(true) await sni.patch('/cgi/id/users/me/deletion', { code: router.query['code'] as string, }) router.push('/') } catch (err: any) { setError(err.toString()) } finally { setBusy(false) } } return ( Delete Account Confirm delete your account from Solar Network } severity="error"> {error} Are you sure you want to delete your account? This action is irreversible. All the resources created by you or related to your account will be deleted. If you have changed your mind, you can close this tab at any time, nothing will be affected. ) }