import React from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import classnames from 'classnames'; import { BLOCK_SIZES, BorderColor, DISPLAY, FLEX_DIRECTION, FONT_WEIGHT, JustifyContent, Size, TextColor, TextVariant, TEXT_ALIGN, } from '../../../helpers/constants/design-system'; import { AvatarNetwork, AvatarToken, BadgeWrapper, Text, } from '../../component-library'; import Box from '../../ui/box/box'; import { getNativeCurrencyImage } from '../../../selectors'; import Tooltip from '../../ui/tooltip'; import { useI18nContext } from '../../../hooks/useI18nContext'; export const MultichainTokenListItem = ({ className, onClick, tokenSymbol, tokenImage, primary, secondary, title, }) => { const t = useI18nContext(); const primaryTokenImage = useSelector(getNativeCurrencyImage); const dataTheme = document.documentElement.getAttribute('data-theme'); return ( { e.preventDefault(); onClick(); }} > } marginRight={3} > {title === 'ETH' ? t('networkNameEthereum') : title} {secondary} {Number(primary).toFixed(3)} {tokenSymbol}{' '} ); }; MultichainTokenListItem.propTypes = { /** * An additional className to apply to the TokenList. */ className: PropTypes.string, /** * The onClick handler to be passed to the MultichainTokenListItem component */ onClick: PropTypes.func, /** * tokenSymbol represents the symbol of the Token */ tokenSymbol: PropTypes.string, /** * title represents the name of the token and if name is not available then Symbol */ title: PropTypes.string, /** * tokenImage represnts the image of the token icon */ tokenImage: PropTypes.string, /** * primary represents the balance */ primary: PropTypes.string, /** * secondary represents the balance in dollars */ secondary: PropTypes.string, };