"use client"; import Link from "next/link"; import { useEffect, useState } from "react"; import { GearIcon, MenuIcon, SnowflakeIcon } 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 ( <>
Freezmo {!compact ? ( study feed ) : null}
setSettingsOpen(false)} /> ); }