import { useState } from 'react'; import { Store, Handshake, Star, Package } from 'lucide-react'; import GearSwapPage from '@/pages/GearSwapPage'; import TradesPage from '@/pages/TradesPage'; import { TradeReputationPanel } from '@/components/TradeReputationPanel'; import { SellerDashboard } from '@/components/SellerDashboard'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import { LoginArea } from '@/components/auth/LoginArea'; import { cn } from '@/lib/utils'; const TABS = [ { id: 'browse', label: 'Browse', icon: Store }, { id: 'selling', label: 'Selling', icon: Package }, { id: 'trades', label: 'My Trades', icon: Handshake }, { id: 'reputation', label: 'Reputation', icon: Star }, ] as const; type TabId = (typeof TABS)[number]['id']; /** * Marketplace hub — one home for buying/selling: the gear grid, your trades and * your reputation/reviews, as tabs. `/trades` and `/listing/...` deep links keep * working; this is just the front door. */ export default function MarketplaceHubPage() { const { user } = useCurrentUser(); const [tab, setTab] = useState('browse'); return ( <> {/* Tab bar — sticky under the app header, like other toolbars. */}
{TABS.map(({ id, label, icon: Icon }) => { const active = tab === id; return ( ); })}
{tab === 'browse' && } {tab === 'selling' && (
{user ? ( ) : (

Log in to manage your listings.

)}
)} {tab === 'trades' && } {tab === 'reputation' && (
{user ? ( ) : (

Log in to see your reputation and reviews.

)}
)} ); }