import React, { useContext, useState } from 'react'; import PropTypes from 'prop-types'; import { useHistory } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { I18nContext } from '../../../contexts/i18n'; import { Menu, MenuItem } from '../../../components/ui/menu'; import { getBlockExplorerLinkText } from '../../../selectors'; import { NETWORKS_ROUTE } from '../../../helpers/constants/routes'; const AssetOptions = ({ onRemove, onClickBlockExplorer, onViewAccountDetails, onViewTokenDetails, tokenSymbol, isNativeAsset, }) => { const t = useContext(I18nContext); const [assetOptionsButtonElement, setAssetOptionsButtonElement] = useState( null, ); const [assetOptionsOpen, setAssetOptionsOpen] = useState(false); const history = useHistory(); const blockExplorerLinkText = useSelector(getBlockExplorerLinkText); const routeToAddBlockExplorerUrl = () => { history.push(`${NETWORKS_ROUTE}#blockExplorerUrl`); }; const openBlockExplorer = () => { setAssetOptionsOpen(false); onClickBlockExplorer(); }; return ( <>