"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useEffect, useMemo, useState } from "react";
type NavItem = { label: string; href: string };
export default function HeaderClient({
brand,
nav,
}: {
brand: { name: string };
nav: NavItem[];
}) {
const pathname = usePathname();
const [mobileOpen, setMobileOpen] = useState(false);
const isHome = pathname === "/";
const navItems = useMemo(() => nav.filter((x) => x.href !== "/"), [nav]);
useEffect(() => {
if (!mobileOpen) return;
document.body.style.overflow = "hidden";
return () => {
document.body.style.overflow = "";
};
}, [mobileOpen]);
return (
<>