import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Icon, IconName, IconSize, } from '../../../components/component-library'; import { IconColor } from '../../../helpers/constants/design-system'; import UrlIcon from '../../../components/ui/url-icon'; import { I18nContext } from '../../../contexts/i18n'; export default function SelectedToken({ onClick, onClose, selectedToken, testId, }) { const t = useContext(I18nContext); const hasIcon = selectedToken?.iconUrl && selectedToken?.symbol; const onKeyUp = (e) => { if (e.key === 'Escape') { onClose(); } else if (e.key === 'Enter') { onClick(e); } }; return (