Files
vercel__workflow/docs/components/geistdocs/navbar.tsx
Pranay Prakash 6c9c32e275 fix(docs): hide preview-only nav items in production (#1941)
The geistdocs facelift (#1666) dropped the VERCEL_ENV-based filter on
nav items, so the "Internal" entry (preview: true) was visible on the
production docs deployment. Restore the filter in the server-rendered
Navbar and pass the filtered list to MobileMenu so both desktop and
mobile honor it.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 12:09:38 +00:00

32 lines
1.2 KiB
TypeScript

import { basePath, Logo, nav, suggestions } from '@/geistdocs';
import { Chat } from './chat';
import { DesktopMenu } from './desktop-menu';
import { MobileMenu } from './mobile-menu';
import { NavbarLogo } from './navbar-logo';
import { SearchButton } from './search';
export const Navbar = () => {
const isPreview =
process.env.VERCEL_ENV === 'preview' ||
process.env.NODE_ENV === 'development';
// Filter nav items: show preview-only entries in preview/dev environments
const visibleNav = nav.filter((item) => !item.preview || isPreview);
return (
<header className="sticky top-0 z-40 flex h-16 justify-center border-b bg-background-200">
<div className="mx-auto flex w-full max-w-[1448px] justify-between px-2">
<div className="flex select-none flex-row items-center">
<NavbarLogo className="ml-4" logo={<Logo />} variant="oss" />
<DesktopMenu className="hidden pl-6 lg:flex" items={visibleNav} />
</div>
<div className="mr-4 flex flex-row items-center justify-end gap-2">
<SearchButton className="hidden lg:flex" />
<Chat basePath={basePath} suggestions={suggestions} />
<MobileMenu items={visibleNav} />
</div>
</div>
</header>
);
};