import React, { useContext } from 'react';
import { useSelector } from 'react-redux';
import PropTypes from 'prop-types';
import { I18nContext } from '../../../../contexts/i18n';
import InfoTooltip from '../../../../components/ui/info-tooltip';
import ExchangeRateDisplay from '../../exchange-rate-display';
import { getUseCurrencyRateCheck } from '../../../../selectors';
const QuoteDetails = ({
slippage,
sourceTokenValue,
sourceTokenSymbol,
destinationTokenValue,
destinationTokenSymbol,
liquiditySourceKey,
minimumAmountReceived,
feeInEth,
networkFees,
metaMaskFee,
hideEstimatedGasFee,
}) => {
const t = useContext(I18nContext);
const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck);
return (
{t('swapMaxSlippage')}
{`${slippage}%`}
{t('swapAmountReceived')}
{minimumAmountReceived}
{` ${destinationTokenSymbol}`}
{!hideEstimatedGasFee && (
{t('swapEstimatedNetworkFees')}
{feeInEth}
{useCurrencyRateCheck && ` (${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;