import { IconButton } from '@components/shared/Button' import SheenLoader from '@components/shared/SheenLoader' import { ChevronLeftIcon } from '@heroicons/react/20/solid' import mangoStore from '@store/mangoStore' // import dayjs from 'dayjs' import { useTranslation } from 'next-i18next' import dynamic from 'next/dynamic' import { useMemo } from 'react' import { formatFixedDecimals } from 'utils/numbers' const DetailedAreaChart = dynamic( () => import('@components/shared/DetailedAreaChart'), { ssr: false } ) const PerpMarketDetails = ({ perpMarket, setShowPerpDetails, }: { perpMarket: string setShowPerpDetails: (x: string) => void }) => { const { t } = useTranslation(['common', 'trade']) const perpStats = mangoStore((s) => s.perpStats.data) const loadingPerpStats = mangoStore((s) => s.perpStats.loading) // const perpMarkets = mangoStore((s) => s.perpMarkets) const marketStats = useMemo(() => { if (!perpStats) return [] return perpStats.filter((stat) => stat.perp_market === perpMarket).reverse() }, [perpStats]) return (