import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import { I18nContext } from '../../../../contexts/i18n'; import InfoTooltip from '../../../../components/ui/info-tooltip'; import ExchangeRateDisplay from '../../exchange-rate-display'; const QuoteDetails = ({ slippage, sourceTokenValue, sourceTokenSymbol, destinationTokenValue, destinationTokenSymbol, liquiditySourceKey, minimumAmountReceived, feeInEth, networkFees, metaMaskFee, hideEstimatedGasFee, }) => { const t = useContext(I18nContext); return (
{t('swapRate')}
{t('swapMaxSlippage')}
{`${slippage}%`}
{t('swapAmountReceived')}
{minimumAmountReceived} {` ${destinationTokenSymbol}`}
{!hideEstimatedGasFee && (
{t('swapEstimatedNetworkFees')}
{feeInEth} {` (${networkFees})`}
)}
{t('swapSource')}
{t(liquiditySourceKey)}
{t('swapMetaMaskFee')}
{t('swapMetaMaskFeeDescription', [metaMaskFee])}
); }; QuoteDetails.propTypes = { slippage: PropTypes.number.isRequired, sourceTokenValue: PropTypes.string.isRequired, sourceTokenSymbol: PropTypes.string.isRequired, destinationTokenValue: PropTypes.string.isRequired, destinationTokenSymbol: PropTypes.string.isRequired, liquiditySourceKey: PropTypes.string.isRequired, minimumAmountReceived: PropTypes.string.isRequired, feeInEth: PropTypes.string.isRequired, networkFees: PropTypes.string.isRequired, metaMaskFee: PropTypes.number.isRequired, hideEstimatedGasFee: PropTypes.bool, }; export default QuoteDetails;