import FormatNumericValue from '@components/shared/FormatNumericValue' import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements' import Tooltip from '@components/shared/Tooltip' import { Disclosure, Transition } from '@headlessui/react' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { useTranslation } from 'next-i18next' import useMangoGroup from 'hooks/useMangoGroup' import useMangoAccount from 'hooks/useMangoAccount' import { useViewport } from 'hooks/useViewport' import { breakpoints } from 'utils/theme' import { MouseEventHandler } from 'react' import MarketLogos from '@components/trade/MarketLogos' import { HealthContribution } from 'types' const MarketsHealthTable = ({ initMarkets, maintMarkets, handleLegendClick, handleLegendMouseEnter, handleLegendMouseLeave, }: { initMarkets: HealthContribution[] maintMarkets: HealthContribution[] handleLegendClick: (cont: HealthContribution) => void handleLegendMouseEnter: (cont: HealthContribution) => void handleLegendMouseLeave: MouseEventHandler }) => { const { t } = useTranslation(['common', 'account', 'trade']) const { group } = useMangoGroup() const { mangoAccount } = useMangoAccount() const { width } = useViewport() const isMobile = width ? width < breakpoints.sm : false return group && mangoAccount ? ( !isMobile ? (
{t('market')} |
|
|
{asset} |
{initContribution > 0 ? initAssetWeight.toFixed(2) : initContribution < 0 ? initLiabWeight.toFixed(2) : 0} x |
{maintContribution > 0 ? maintAssetWeight.toFixed(2) : maintContribution < 0 ? maintLiabWeight.toFixed(2) : 0} x |
---|
{asset}
{initContribution > 0 ? initAssetWeight.toFixed(2) : initContribution < 0 ? initLiabWeight.toFixed(2) : 0} x
{maintContribution > 0 ? maintAssetWeight.toFixed(2) : maintContribution < 0 ? maintLiabWeight.toFixed(2) : 0} x