import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import IconWithFallback from '../../ui/icon-with-fallback'; import Identicon from '../../ui/identicon'; import { DISPLAY, FLEX_DIRECTION, TypographyVariant, FONT_WEIGHT, AlignItems, JustifyContent, TEXT_ALIGN, TextColor, } from '../../../helpers/constants/design-system'; import Box from '../../ui/box/box'; import { I18nContext } from '../../../contexts/i18n'; import Typography from '../../ui/typography'; import { CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP } from '../../../../shared/constants/network'; export default function NetworkAccountBalanceHeader({ networkName, accountName, accountBalance, tokenName, // Derived from nativeCurrency accountAddress, chainId, }) { const t = useContext(I18nContext); const networkIcon = CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[chainId]; const networkIconWrapperClass = networkIcon ? 'network-account-balance-header__network-account__ident-icon-ethereum' : 'network-account-balance-header__network-account__ident-icon-ethereum--gray'; return ( {networkName} {accountName} {t('balance')} {accountBalance} {tokenName} ); } NetworkAccountBalanceHeader.propTypes = { networkName: PropTypes.string, accountName: PropTypes.string, accountBalance: PropTypes.string, tokenName: PropTypes.string, accountAddress: PropTypes.string, chainId: PropTypes.string, };