import { useCallback, useState } from 'react' import { CurrencyDollarIcon, ExternalLinkIcon, LinkIcon, } from '@heroicons/react/outline' import useMangoStore from '../stores/useMangoStore' import { abbreviateAddress } from '../utils' import useMarginInfo from '../hooks/useMarginInfo' import PageBodyContainer from '../components/PageBodyContainer' import TopBar from '../components/TopBar' import AccountAssets from '../components/account-page/AccountAssets' import AccountBorrows from '../components/account-page/AccountBorrows' import AccountOrders from '../components/account-page/AccountOrders' import AccountHistory from '../components/account-page/AccountHistory' import AccountsModal from '../components/AccountsModal' import EmptyState from '../components/EmptyState' const TABS = [ 'Assets', 'Borrows', // 'Stats', // 'Positions', 'Orders', 'History', ] export default function Account() { const [activeTab, setActiveTab] = useState(TABS[0]) const [showAccountsModal, setShowAccountsModal] = useState(false) const accountMarginInfo = useMarginInfo() const connected = useMangoStore((s) => s.wallet.connected) const selectedMarginAccount = useMangoStore( (s) => s.selectedMarginAccount.current ) const handleTabChange = (tabName) => { setActiveTab(tabName) } const handleCloseAccounts = useCallback(() => { setShowAccountsModal(false) }, []) return (

Account

{selectedMarginAccount ? (
) : null}
{selectedMarginAccount ? ( <>
Overview
{accountMarginInfo ? (
{accountMarginInfo.map((info) => (
{info.label}
{info.icon}
{`${info.currency}${info.value}${info.unit}`}
))}
) : null}
) : connected ? ( } onClickButton={() => setShowAccountsModal(true)} title="No Account Found" /> ) : ( } title="Connect Wallet" /> )}
{showAccountsModal ? ( ) : null}
) } const TabContent = ({ activeTab }) => { switch (activeTab) { case 'Assets': return case 'Borrows': return case 'Stats': return
Stats
case 'Positions': return
Positions
case 'Orders': return case 'History': return default: return } }