import React from 'react'; import { useSelector } from 'react-redux'; import { Display, AlignItems, JustifyContent, BackgroundColor, BlockSize, IconColor, } from '../../../helpers/constants/design-system'; import { getSelectedAccountCachedBalance } from '../../../selectors'; import { getIsCustodianSupportedChain } from '../../../selectors/institutional/selectors'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { getProviderConfig } from '../../../ducks/metamask/metamask'; import { Icon, IconName, IconSize, Box, Text } from '../../component-library'; const WrongNetworkNotification = () => { const t = useI18nContext(); const providerConfig = useSelector(getProviderConfig); const balance = useSelector(getSelectedAccountCachedBalance); const isCustodianSupportedChain = useSelector(getIsCustodianSupportedChain); const network = providerConfig.nickname || providerConfig.type; return !isCustodianSupportedChain && balance ? ( {t('custodyWrongChain', [ network ? network.charAt(0).toUpperCase() + network.slice(1) : '', ])} ) : null; }; export default WrongNetworkNotification;