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'; import { useTranslation } from '@/contexts/language'; const TABS = [ { id: 'browse', labelKey: 'marketUi.hub.browse', icon: Store }, { id: 'selling', labelKey: 'marketUi.hub.selling', icon: Package }, { id: 'trades', labelKey: 'marketUi.hub.myTrades', icon: Handshake }, { id: 'reputation', labelKey: 'marketUi.hub.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 { t } = useTranslation(); const { user } = useCurrentUser(); const [tab, setTab] = useState('browse'); return ( <> {/* Tab bar — sticky under the app header, like other toolbars. */}
{TABS.map(({ id, labelKey, icon: Icon }) => { const active = tab === id; return ( ); })}
{tab === 'browse' && } {tab === 'selling' && (
{user ? ( ) : (

{t('marketUi.hub.loginListings')}

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

{t('marketUi.hub.loginReputation')}

)}
)} ); }