import { useMemo, useState } from 'react' import TabButtons from '@components/shared/TabButtons' import SwapTradeBalances from '../shared/BalancesTable' import mangoStore from '@store/mangoStore' import SwapHistoryTable from './SwapHistoryTable' import useMangoAccount from 'hooks/useMangoAccount' import ManualRefresh from '@components/shared/ManualRefresh' import { useViewport } from 'hooks/useViewport' import { breakpoints } from 'utils/theme' const SwapInfoTabs = () => { const [selectedTab, setSelectedTab] = useState('balances') const openOrders = mangoStore((s) => s.mangoAccount.openOrders) const { mangoAccount } = useMangoAccount() const { width } = useViewport() const isMobile = width ? width < breakpoints.lg : false const tabsWithCount: [string, number][] = useMemo(() => { return [ ['balances', 0], ['swap:swap-history', 0], ] }, [openOrders, mangoAccount]) return (
setSelectedTab(tab)} values={tabsWithCount} showBorders />
{selectedTab === 'balances' ? : null} {selectedTab === 'swap:swap-history' ? : null}
) } export default SwapInfoTabs