import React from "react"; import { BigNumber, FixedNumber } from "@ethersproject/bignumber"; import { commify } from "@ethersproject/units"; const ETH_FEED_DECIMALS = 8; type USDValueProps = { value: BigNumber | undefined; }; const USDValue: React.FC = ({ value }) => ( {value ? ( <> $ {commify( FixedNumber.fromValue(value, ETH_FEED_DECIMALS).round(2).toString() )} {" "} / ETH ) : ( "N/A" )} ); export default React.memo(USDValue);