import React, { useContext, useRef, useState } from 'react'; import PropTypes from 'prop-types'; import { I18nContext } from '../../../contexts/i18n'; import { Menu, MenuItem } from '../../ui/menu'; import { ButtonIcon } from '../../component-library'; import { ICON_NAMES } from '../../component-library/icon/deprecated'; import { Color } from '../../../helpers/constants/design-system'; const NftOptions = ({ onRemove, onViewOnOpensea }) => { const t = useContext(I18nContext); const [nftOptionsOpen, setNftOptionsOpen] = useState(false); const ref = useRef(false); return (
setNftOptionsOpen(true)} color={Color.textDefault} ariaLabel={t('nftOptions')} /> {nftOptionsOpen ? ( setNftOptionsOpen(false)} > {onViewOnOpensea ? ( { setNftOptionsOpen(false); onViewOnOpensea(); }} > {t('viewOnOpensea')} ) : null} { setNftOptionsOpen(false); onRemove(); }} > {t('removeNFT')} ) : null}
); }; NftOptions.propTypes = { onRemove: PropTypes.func.isRequired, onViewOnOpensea: PropTypes.func, }; export default NftOptions;