"use client"; import Link from "next/link"; import { useEffect, useState } from "react"; import { GearIcon, MenuIcon } from "@/components/icons"; import { SettingsDialog } from "@/components/SettingsDialog"; import { ThemeToggle } from "@/components/ThemeToggle"; import { sidebarOpen } from "@/lib/nav"; import { OPEN_SETTINGS_EVENT } from "@/lib/ui-events"; import { cn } from "@/lib/utils"; /** * Minimal, sticky frosted top bar: brand on the left, quiet actions on the * right. The phone layout keeps the brand compact and relies on the tab bar * for navigation. */ export function AppHeader({ className, compact = false }: { className?: string; compact?: boolean }) { const [settingsOpen, setSettingsOpen] = useState(false); useEffect(() => { const onOpen = () => setSettingsOpen(true); window.addEventListener(OPEN_SETTINGS_EVENT, onOpen); return () => window.removeEventListener(OPEN_SETTINGS_EVENT, onOpen); }, []); // Restore the desktop sidebar width preference once, on the client. useEffect(() => { void import("@/components/Sidebar").then((module) => module.sidebarCollapse.hydrate()); }, []); return ( <> sidebarOpen.toggle()} aria-label="Open menu" className="mr-1 grid size-9 shrink-0 place-items-center rounded-full text-[var(--text-muted)] transition hover:bg-[var(--hover)] hover:text-[var(--text)]" > {/* eslint-disable-next-line @next/next/no-img-element -- static app icon, no optimisation needed */} Freezmo {!compact ? ( study feed ) : null} setSettingsOpen(true)} aria-label="Open settings and Ollama status" title="Settings" className="inline-flex size-9 items-center justify-center rounded-full text-[var(--text-muted)] transition hover:bg-[var(--hover)] hover:text-[var(--text)]" > setSettingsOpen(false)} /> > ); }