import { useEffect } from 'react' import toast from 'react-hot-toast' import { useTranslations } from 'next-intl' import { CHAINS_BY_ID } from '@constants/chains' import { getNetworkTextColor } from '@styles/chains' import { AcceptedChainId } from '@constants/chains' const StandardPageContainer = ({ title, subtitle, children, rightContent, address, connectedChainId, }: { title?: string subtitle?: string children: any rightContent?: any address: string connectedChainId: number }) => { const t = useTranslations('Wallet') useEffect(() => { if (!connectedChainId) return const chain = CHAINS_BY_ID[connectedChainId] const unsupported = AcceptedChainId[connectedChainId] ? false : true let unsupportedToaster if (unsupported) { unsupportedToaster = toast.error( t('Connected to an unsupported network; Please switch networks'), { id: 'unsupported-popup', duration: 5000 } ) } else { toast( <> {t('Connected to')}{' '}
{' '} {chain?.altName ?? chain?.name}{' '}
>, { id: 'standard-popup', duration: 5000 } ) } }, [connectedChainId]) return (