import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { COLORS } from '../../../helpers/constants/design-system'; import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; import { hexWEIToDecGWEI } from '../../../helpers/utils/conversions.util'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Box from '../../../components/ui/box'; import Typography from '../../../components/ui/typography/typography'; import GasTiming from '../../../components/app/gas-timing/gas-timing.component'; import I18nValue from '../../../components/ui/i18n-value'; import InfoTooltip from '../../../components/ui/info-tooltip/info-tooltip'; import LoadingHeartBeat from '../../../components/ui/loading-heartbeat'; import TransactionDetailItem from '../../../components/app/transaction-detail-item/transaction-detail-item.component'; import UserPreferencedCurrencyDisplay from '../../../components/app/user-preferenced-currency-display'; import { useGasFeeContext } from '../../../contexts/gasFee'; const HeartBeat = () => process.env.IN_TEST === 'true' ? null : ; const GasDetailsItem = ({ hexMaximumTransactionFee, hexMinimumTransactionFee, isMainnet, maxFeePerGas, maxPriorityFeePerGas, userAcknowledgedGasMissing, txData, useNativeCurrencyAsPrimaryCurrency, }) => { const t = useI18nContext(); const { estimateUsed, hasSimulationError } = useGasFeeContext(); if (hasSimulationError && !userAcknowledgedGasMissing) return null; return ( () {t('transactionDetailGasTooltipIntro', [ isMainnet ? t('networkNameEthereum') : '', ])} {t('transactionDetailGasTooltipExplanation')} {t('transactionDetailGasTooltipConversion')} } position="bottom" /> } detailTitleColor={COLORS.BLACK} detailText={
} detailTotal={
} subText={t('editGasSubTextFee', [ {estimateUsed === 'high' && '⚠ '}
, ])} subTitle={ } /> ); }; GasDetailsItem.propTypes = { hexMaximumTransactionFee: PropTypes.string, hexMinimumTransactionFee: PropTypes.string, isMainnet: PropTypes.bool, maxFeePerGas: PropTypes.string, maxPriorityFeePerGas: PropTypes.string, userAcknowledgedGasMissing: PropTypes.bool.isRequired, txData: PropTypes.object, useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, }; export default GasDetailsItem;