import React from 'react'; import PropTypes from 'prop-types'; import { COLORS } from '../../../helpers/constants/design-system'; import { PRIORITY_LEVEL_ICON_MAP } from '../../../helpers/constants/gas'; import { useGasFeeContext } from '../../../contexts/gasFee'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { useTransactionModalContext } from '../../../contexts/transaction-modal'; import InfoTooltip from '../../ui/info-tooltip/info-tooltip'; import Typography from '../../ui/typography/typography'; export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { const t = useI18nContext(); const { gasLimit, hasSimulationError, estimateUsed, maxFeePerGas, maxPriorityFeePerGas, supportsEIP1559V2, transaction, } = useGasFeeContext(); const { openModal } = useTransactionModalContext(); const editEnabled = !hasSimulationError || userAcknowledgedGasMissing === true; if (!supportsEIP1559V2 || !estimateUsed || !editEnabled) { return null; } return (