import { Link, useLocation } from 'react-router'; import { LogOut, Moon, PanelLeft, Search, Sun } from 'lucide-react'; import { useSearchContext } from 'fumadocs-ui/contexts/search'; import { SidebarTrigger } from 'fumadocs-ui/components/sidebar/base'; import { useTheme } from 'fumadocs-ui/provider/base'; import { config } from 'virtual:seemore/config'; import { lockSite } from '../lib/auth.js'; import { useSidebarCollapse } from './Sidebar.js'; export function Header() { const search = useSearchContext(); const { resolvedTheme, setTheme } = useTheme(); const location = useLocation(); const { collapsed, toggle } = useSidebarCollapse(); return (
{/* Two triggers, one slot: below `md` the sidebar is a drawer this opens over the page, and at `md` and up it is a rail this hides, leaving the article the room. */} {config.title} {search.enabled ? ( ) : undefined} {/* Read directly, not through a helper, so an unprotected bundle folds this away. */} {import.meta.env.SEEMORE_AUTH ? ( ) : undefined}
); }