import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
import Identicon from '../../ui/identicon';
import ListItem from '../../ui/list-item';
import Tooltip from '../../ui/tooltip';
import InfoIcon from '../../ui/icon/info-icon.component';
import Button from '../../ui/button';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { useMetricEvent } from '../../../hooks/useMetricEvent';
import { updateSendToken } from '../../../ducks/send/send.duck';
import { SEND_ROUTE } from '../../../helpers/constants/routes';
import { SEVERITIES } from '../../../helpers/constants/design-system';
const AssetListItem = ({
className,
'data-testid': dataTestId,
iconClassName,
onClick,
tokenAddress,
tokenSymbol,
tokenDecimals,
tokenImage,
warning,
primary,
secondary,
identiconBorder,
}) => {
const t = useI18nContext();
const dispatch = useDispatch();
const history = useHistory();
const sendTokenEvent = useMetricEvent({
eventOpts: {
category: 'Navigation',
action: 'Home',
name: 'Clicked Send: Token',
},
});
const titleIcon = warning ? (