"use client"; import Link from "next/link"; import { useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; const navItems = [ { href: "/#wohnungen", label: "Wohnungen" }, { href: "/#umgebung", label: "Umgebung" }, { href: "/anfrage", label: "Anfrage" }, ]; export function Header() { const [scrolled, setScrolled] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); const pathname = usePathname(); const isHome = pathname === "/"; useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 12); onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); return () => window.removeEventListener("scroll", onScroll); }, []); // On non-home pages the header is always opaque const transparent = isHome && !scrolled; useEffect(() => { setMobileOpen(false); }, [pathname]); if (pathname?.startsWith("/admin")) return null; return (
Spreewaldzeit
{/* Mobile menu */}
); }