import { useEffect, useState } from 'react' import styled from '@emotion/styled' import useMangoStore from '../stores/useMangoStore' import { useOpenOrders } from '../hooks/useOpenOrders' // import usePerpPositions from '../hooks/usePerpPositions' import FloatingElement from './FloatingElement' import OpenOrdersTable from './OpenOrdersTable' import BalancesTable from './BalancesTable' import PositionsTable from './PerpPositionsTable' import TradeHistoryTable from './TradeHistoryTable' // import FeeDiscountsTable from './FeeDiscountsTable' const TABS = [ 'Balances', 'Open Orders', 'Perp Positions', // 'Fees', 'Trade History', ] const StyledAlertCount = styled.span` font-size: 0.6rem; ` const UserInfoTabs = ({ activeTab, setActiveTab }) => { const openOrders = useOpenOrders() // const perpPositions = usePerpPositions() const handleTabChange = (tabName) => { setActiveTab(tabName) } return (
) } const Count = ({ count }) => (
{count}
) const TabContent = ({ activeTab }) => { switch (activeTab) { case 'Open Orders': return case 'Balances': return case 'Trade History': return case 'Perp Positions': return // case 'Fees': // return // now displayed in trade form. may add back when MRSRM deposits are supported default: return } } const UserInfo = () => { const marketConfig = useMangoStore((s) => s.selectedMarket.config) const isPerpMarket = marketConfig.kind === 'perp' const connected = useMangoStore((s) => s.wallet.connected) const [activeTab, setActiveTab] = useState('') useEffect(() => { isPerpMarket ? setActiveTab(TABS[2]) : setActiveTab(TABS[0]) }, [isPerpMarket]) return (
) } export default UserInfo