'use client'; import { useState } from 'react'; import { usePathname } from 'next/navigation'; import { useAuth } from '@/contexts/AuthContext'; import Wordmark from '@/components/Wordmark'; import NotificationBell from '@/components/NotificationBell'; import LocaleSwitcher from '@/components/LocaleSwitcher'; import { useT } from '@/contexts/LocaleContext'; export default function Nav() { const { user, tier, scansRemaining, signOut } = useAuth(); const t = useT(); const pathname = usePathname() || ''; // Session 17 — read counter sits in the global nav, but the audit // flagged it as noise outside the scan flow. Restrict it to /scan // and /dashboard (where the slate-scan lives) so it acts as a // quota indicator next to the action it gates, not a chrome pill. const showReadCounter = pathname === '/scan' || pathname.startsWith('/scan/') || pathname === '/dashboard' || pathname.startsWith('/dashboard/'); const [mobileOpen, setMobileOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false); // Session 12 — translation labels resolved at render time so a // locale switch flips the nav without a code change. // Session 13 — "Scan" removed from the primary nav: The Slate on // /dashboard IS the scan surface (click [Read] on any prop). The // /scan page still exists as a fallback for custom props and is // reachable from the slate's "Scan manually" empty-state CTA. const NAV_LINKS = [ { label: t('nav.tracker'), href: '/tracker' }, { label: t('nav.ledger'), href: '/ledger' }, { label: t('nav.pricing'), href: '/pricing' }, { label: 'Blog', href: '/blog' }, ]; return ( ); }