import { Grid, GridItem } from '@chakra-ui/react'; import React from 'react'; import type { Path } from 'react-hook-form'; import config from 'configs/app'; import { FormFieldCheckbox } from 'toolkit/components/forms/fields/FormFieldCheckbox'; import type { Inputs as FormFields } from './AddressForm'; const tokenStandardName = config.chain.tokenStandard; interface NotificationOption { readonly id: string; readonly label: string; } export const NOTIFICATION_OPTIONS: ReadonlyArray = [ { id: 'native', label: config.chain.currency.symbol || '' }, { id: 'ERC-20', label: `${ tokenStandardName }-20` }, ...config.chain.additionalTokenTypes.map((item) => ({ id: item.id, label: item.name })), { id: 'ERC-721', label: `${ tokenStandardName }-721, ${ tokenStandardName }-1155 (NFT)` }, { id: 'ERC-404', label: `${ tokenStandardName }-404` }, ]; export const NOTIFICATIONS = NOTIFICATION_OPTIONS.map(({ id }) => id); export default function AddressFormNotifications() { return ( { NOTIFICATION_OPTIONS.map((notification) => { const incomingFieldName = `notification_settings.${ notification.id }.incoming` as Path; const outgoingFieldName = `notification_settings.${ notification.id }.outcoming` as Path; return ( { notification.label } name={ incomingFieldName } label="Incoming" /> name={ outgoingFieldName } label="Outgoing" /> ); }) } ); }