import { BZZ } from '@ethersphere/bee-js' import { ReactElement, useContext } from 'react' import Upload from 'remixicon-react/UploadLineIcon' import WithdrawDepositModal from '../components/WithdrawDepositModal' import { Context as BeeContext } from '../providers/Bee' import { Context as SettingsContext } from '../providers/Settings' export default function WithdrawModal(): ReactElement { const { beeApi } = useContext(SettingsContext) const { refresh } = useContext(BeeContext) return ( } min={BZZ.fromPLUR('1')} action={async (amount: BZZ) => { if (!beeApi) { throw new Error('Bee URL is not valid') } const transactionHash = await beeApi.withdrawBZZFromChequebook(amount) refresh() return transactionHash }} /> ) }