import { FC, useMemo } from 'react'; import { OverlayTrigger, Tooltip } from 'react-bootstrap'; import { LocalizeFormattedNumber, LocalizeShortNumber } from '../../../api'; import { Flex, LayoutCurrencyIcon, Text } from '../../../common'; interface CurrencyViewProps { type: number; amount: number; short: boolean; } export const CurrencyView: FC = props => { const { type = -1, amount = -1, short = false } = props; const element = useMemo(() => { return ( { short ? LocalizeShortNumber(amount) : LocalizeFormattedNumber(amount) } ); }, [ amount, short, type ]); if(!short) return element; return ( { LocalizeFormattedNumber(amount) } }> { element } ); }