import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { useSelector } from 'react-redux'; import { COLORS } from '../../../helpers/constants/design-system'; import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; import { getPreferences } from '../../../selectors'; import { useGasFeeContext } from '../../../contexts/gasFee'; import Box from '../../ui/box'; import I18nValue from '../../ui/i18n-value'; import LoadingHeartBeat from '../../ui/loading-heartbeat'; import GasTiming from '../gas-timing/gas-timing.component'; import TransactionDetailItem from '../transaction-detail-item/transaction-detail-item.component'; import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'; import GasDetailsItemTitle from './gas-details-item-title'; const GasDetailsItem = ({ userAcknowledgedGasMissing = false }) => { const { estimateUsed, hasSimulationError, maximumCostInHexWei: hexMaximumTransactionFee, minimumCostInHexWei: hexMinimumTransactionFee, maxPriorityFeePerGas, maxFeePerGas, } = useGasFeeContext(); const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); if (hasSimulationError && !userAcknowledgedGasMissing) { return null; } return ( } detailTitleColor={COLORS.BLACK} detailText={
} detailTotal={
} subText={ <> {estimateUsed === 'high' && '⚠ '}
} subTitle={ } /> ); }; GasDetailsItem.propTypes = { userAcknowledgedGasMissing: PropTypes.bool, }; export default GasDetailsItem;