import { percentFormat } from '../../utils' import { useTranslation } from 'next-i18next' const EstPriceImpact = ({ priceImpact, }: { priceImpact?: { slippage: number[]; takerFee: number[] } }) => { const { t } = useTranslation('common') const priceImpactAbs = priceImpact.slippage[0] const priceImpactRel = priceImpact.slippage[1] return (
{t('est-slippage')} 0.005 && priceImpactRel <= 0.01 ? 'text-th-orange' : 'text-th-red' }`} > ${priceImpactAbs.toFixed(2)} | {percentFormat.format(priceImpactRel)}
{t('taker-fee')} ${priceImpact.takerFee[0].toFixed(2)} | {percentFormat.format(priceImpact.takerFee[1])}
) } export default EstPriceImpact