import { useState } from 'react' import TopBar from '../components/TopBar' import PageBodyContainer from '../components/PageBodyContainer' import StatsTotals from '../components/stats_page/StatsTotals' import StatsAssets from '../components/stats_page/StatsAssets' import StatsPerps from '../components/stats_page/StatsPerps' import useMangoStats from '../hooks/useMangoStats' import Swipeable from '../components/mobile/Swipeable' import SwipeableTabs from '../components/mobile/SwipeableTabs' import Tabs from '../components/Tabs' import { useViewport } from '../hooks/useViewport' import { breakpoints } from '../components/TradePageGrid' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import { useTranslation } from 'next-i18next' export async function getServerSideProps({ locale }) { return { props: { ...(await serverSideTranslations(locale, ['common'])), // Will be passed to the page component as props }, } } export default function StatsPage() { const { t } = useTranslation('common') const TABS = [ 'Totals', 'Assets', 'Perps', // 'Markets', // 'Liquidations', ] const { latestStats, stats, perpStats } = useMangoStats() const [viewIndex, setViewIndex] = useState(0) const [activeTab, setActiveTab] = useState(TABS[0]) const { width } = useViewport() const isMobile = width ? width < breakpoints.sm : false const handleChangeViewIndex = (index) => { setViewIndex(index) } const handleTabChange = (tabName) => { setActiveTab(tabName) } return (

{t('stats')}

{!isMobile ? ( ) : ( )}
{!isMobile ? ( ) : ( )}
) } const TabContent = ({ activeTab, latestStats, perpStats, stats }) => { switch (activeTab) { case 'Totals': return case 'Assets': return case 'Perps': return default: return } }