import { InformationCircleIcon } from '@heroicons/react/outline' import Tippy from '@tippyjs/react' import 'tippy.js/animations/scale.css' 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('price-impact')}: 0.005 && priceImpactRel <= 0.01 ? 'text-th-orange' : 'text-th-red' }`} > ${priceImpactAbs.toFixed(2)} | {percentFormat.format(priceImpactRel)} document.body} maxWidth="20rem" interactive delay={0} content={
{t('slippage')}: ${priceImpact.slippage[0].toFixed(2)} | {percentFormat.format(priceImpact.slippage[1])}
{/*
Maker Fee: ${priceImpact.makerFee[0]} | {priceImpact.makerFee[1].toFixed(2)}%
*/}
{t('taker-fee')}: ${priceImpact.takerFee[0].toFixed(2)} | {percentFormat.format(priceImpact.takerFee[1])}
} >
) } export default EstPriceImpact