import React from 'react'; import PropTypes from 'prop-types'; import { TransactionType } from '../../../../shared/constants/transaction'; import { PRIMARY } from '../../../helpers/constants/common'; import { Text } from '../../component-library'; import { FONT_WEIGHT, TextVariant, } from '../../../helpers/constants/design-system'; import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'; const ConfirmTitle = ({ title, hexTransactionAmount, txData }) => { const isContractInteraction = txData.type === TransactionType.contractInteraction; const hideTitle = (isContractInteraction || txData.type === TransactionType.deployContract) && txData.txParams?.value === '0x0'; if (hideTitle) { return null; } if (title) { return ( {title} ); } return ( ); }; ConfirmTitle.propTypes = { txData: PropTypes.object.isRequired, title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), hexTransactionAmount: PropTypes.string, }; export default ConfirmTitle;