// Context import { LoadingStatusContext } from '@freesewing/react/context/LoadingStatus' import { ModalContext } from '@freesewing/react/context/Modal' // Hooks import React, { useState, useContext } from 'react' import { useAccount } from '@freesewing/react/hooks/useAccount' import { useBackend } from '@freesewing/react/hooks/useBackend' // Components import { Link as WebLink } from '@freesewing/react/components/Link' import { BackIcon as ExitIcon, TrashIcon } from '@freesewing/react/components/Icon' import { Popout } from '@freesewing/react/components/Popout' import { IconButton } from '@freesewing/react/components/Button' import { ModalWrapper } from '@freesewing/react/components/Modal' /* * Component for the account/actions/remove page */ export const Remove = () => { // Hooks const backend = useBackend() const { signOut, account } = useAccount() // Context const { setLoadingStatus } = useContext(LoadingStatusContext) const { setModal, clearModal } = useContext(ModalContext) // Helper method to remove the account const removeAccount = async () => { setLoadingStatus([true, 'Talking to the backend']) const result = await backend.removeAccount() if (result.success) { setLoadingStatus([true, 'Done. Or rather, gone.', true, true]) signOut() } else setLoadingStatus([true, 'An error occured. Please report this', true, false]) } if (account.control === 5) return ( <>

This button is red for a reason.

Remove your FreeSewing account ) return (
setModal(

There is no way back from this

If this is what you want, then go ahead.

Remove your FreeSewing account Back to safety
) } > Remove your FreeSewing account
) }