"use client"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; import { CONTACT, NAV_LINKS } from "@/lib/site"; import type { CustomerUser } from "@/lib/meshkee/types"; import { CartButton } from "@/components/cart/CartButton"; import { UserMenu } from "@/components/UserMenu"; import { IconPhone } from "./icons"; const ACTIVE_LINK = "rounded-full bg-white px-4 py-2 text-sm font-semibold text-secondary"; const INACTIVE_LINK = "whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium text-white/80 transition-colors hover:text-primary"; export function Header({ user, isAdmin, logoUrl, logoDarkUrl, }: { user: CustomerUser | null; isAdmin: boolean; logoUrl: string | null; logoDarkUrl: string | null; }) { const pathname = usePathname(); const [open, setOpen] = useState(false); // Header sits on the navy bar (dark background): prefer the dashboard's // dark-background logo variant, then its light variant, then the bundled // local mark — only the local fallback needs the CSS invert (see // CONTEXT.md "Dynamic logo/favicon"). const headerLogoSrc = logoDarkUrl || logoUrl || "/images/logo.png"; const headerLogoNeedsInvert = !logoDarkUrl && !logoUrl; const Logo = ( setOpen(false)}> استاد علی عالمی ); return (
{/* Mobile/tablet row: hamburger on the right, logo centered, cart on the left. */}
{Logo}
{/* Desktop row: logo right, nav middle, phone/user/cart left (standard RTL order). */}
{Logo}
{CONTACT.phoneLabel}
{open && (
)}
); }