'use client'; import { useEffect, useState } from 'react'; import { useTranslations } from 'next-intl'; import { SignInButton, UserButton, Show } from '@clerk/nextjs'; import BrandMark from './BrandMark'; import DownloadCTA from './DownloadCTA'; import styles from './Navbar.module.css'; /* Absolute-path anchors so the navbar also works from /privacy, /terms, and the other legal pages that render this chrome. */ const NAV_ITEMS = [ { href: '/#how-it-works', key: 'how_it_works' }, { href: '/#memory', key: 'memory' }, { href: '/#proof', key: 'benchmark' }, { href: '/#open-source', key: 'open_source' }, { href: '/#pricing', key: 'pricing' }, ] as const; /** * Fixed top navigation. Transparent over the hero, gains a blurred backdrop * + hairline border after a small scroll. Collapses to a menu button below * 860px; the mobile panel reuses the same anchor list. * * Stays a Client Component for scroll-aware backdrop + menu state. All * strings under `landing.navbar.*`. */ export default function Navbar() { const t = useTranslations('landing.navbar'); const [scrolled, setScrolled] = useState(false); const [open, setOpen] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 8); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); const headerClass = [ styles.header, scrolled || open ? styles.headerScrolled : '', ] .filter(Boolean) .join(' '); return (
{t('ctas.download')}
{open ? ( ) : null}
); } function MenuIcon({ open }: { readonly open: boolean }) { return ( ); }