import { Currency, Percent, Price } from 'moonbeamswap' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' import { AutoColumn } from '../../components/Column' import { AutoRow } from '../../components/Row' import { ONE_BIPS } from '../../constants' import { Field } from '../../state/mint/actions' import { TYPE } from '../../theme' export function PoolPriceBar({ currencies, noLiquidity, poolTokenPercentage, price }: { currencies: { [field in Field]?: Currency } noLiquidity?: boolean poolTokenPercentage?: Percent price?: Price }) { const theme = useContext(ThemeContext) return ( {price?.toSignificant(6) ?? '-'} {currencies[Field.CURRENCY_B]?.symbol} per {currencies[Field.CURRENCY_A]?.symbol} {price?.invert()?.toSignificant(6) ?? '-'} {currencies[Field.CURRENCY_A]?.symbol} per {currencies[Field.CURRENCY_B]?.symbol} {noLiquidity && price ? '100' : (poolTokenPercentage?.lessThan(ONE_BIPS) ? '<0.01' : poolTokenPercentage?.toFixed(2)) ?? '0'} % Share of Pool ) }