import { Token } from '@/utils/types' import _ from 'lodash' import numeral from 'numeral' import { memo } from 'react' import { LoaderIcon } from 'react-hot-toast' export const PoolCardBody = memo( ({ pool, poolData, poolApyData, }: { pool: Token poolData: any poolApyData: any }) => { const format = poolData.totalLockedUSD > 1000000 ? '$0,0.0' : '$0,0' return (
{poolData && numeral(poolData.totalLockedUSD).format(format)}
{pool.priceUnits}
) } ) const PoolTokenIcons = memo(({ pool }: { pool: Token }) => { if (pool.poolTokens.length === 3) { return (
{pool.poolTokens.length === 3 && (
{pool.poolTokens[0].symbol}
)}
{pool.poolTokens.slice(1).map((token, i) => ( {token.symbol} ))}
) } else { return (
{pool.poolTokens.map((token, i) => (
{token.symbol}
))}
) } }) const ApyDisplay = ({ pool, poolApyData }) => { const apy = poolApyData.fullCompoundedAPY > 10000 ? 10000 : poolApyData.fullCompoundedAPY if (!pool.incentivized) { return '' } if (poolApyData.fullCompoundedAPY === undefined) { return } return (
{apy ? `${numeral(apy / 100).format('0,0%')}${ poolApyData.fullCompoundedAPY > 10000 ? '+' : '' }` : `0%`}
APY
) }