import React from 'react'; import PropTypes from 'prop-types'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Popover from '../../ui/popover'; import Box from '../../ui/box'; import Button from '../../ui/button'; import Typography from '../../ui/typography'; import { DISPLAY, FLEX_DIRECTION, FONT_WEIGHT, JustifyContent, TextColor, TypographyVariant, } from '../../../helpers/constants/design-system'; import Identicon from '../../ui/identicon'; import { shortenAddress } from '../../../helpers/utils/util'; import { Icon, IconName } from '../../component-library'; const SetApproveForAllWarning = ({ collectionName, senderAddress, name, total, isERC721, onSubmit, onCancel, }) => { const t = useI18nContext(); const footer = ( ); return ( {t('yourNFTmayBeAtRisk')} {name} {` (${shortenAddress(senderAddress)})`} {isERC721 && total && ( {`${t('total')}: ${total}`} )} {t('nftWarningContent', [ {t('nftWarningContentBold', [collectionName || ''])} , {t('nftWarningContentGrey')} , ])} ); }; SetApproveForAllWarning.propTypes = { /** * NFT collection name that is being approved */ collectionName: PropTypes.string, /** * Address of a current user that is approving collection */ senderAddress: PropTypes.string, /** * Name of a current user that is approving collection */ name: PropTypes.string, /** * Total number of items that are being approved */ total: PropTypes.string, /** * Is asset standard ERC721 */ isERC721: PropTypes.bool, /** * Function that approves collection */ onSubmit: PropTypes.func, /** * Function that rejects collection */ onCancel: PropTypes.func, }; export default SetApproveForAllWarning;