"use client"; import { useState, useEffect } from "react"; import Link from "next/link"; import { useCart } from "./CartContext"; import { ShoppingBag, ArrowRight, Home, UtensilsCrossed, MapPin, Star, Phone, X } from "lucide-react"; import LanguageSwitcher from "./LanguageSwitcher"; import { useLanguage } from "@/lib/language-context"; import { getTranslation } from "@/lib/translations"; import { motion, AnimatePresence } from "framer-motion"; import { usePathname } from "next/navigation"; /** * ============================================================================= * GLOBAL NAVIGATION BAR — Shahi Kitchen (Luxury Edition) * ============================================================================= */ interface NavbarProps { variant?: "default" | "menu"; } export default function Navbar({ variant = "default" }: NavbarProps) { const [isOpen, setIsOpen] = useState(false); const [scrolled, setScrolled] = useState(false); const { totalItems, openCart } = useCart(); const { language } = useLanguage(); const t = getTranslation(language); const pathname = usePathname(); // Scroll effect - only for subtle visual polish, NOT height (height must stay consistent) useEffect(() => { const handleScroll = () => setScrolled(window.scrollY > 20); window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const navLinks = [ { href: "/", label: t.nav.home }, { href: "/menu", label: t.nav.menu }, { href: "/locations", label: t.nav.locations }, { href: "/#experience", label: t.nav.experience }, { href: "/#contact", label: t.nav.contact }, ]; // Determine active link (supports hash links) const isActive = (href: string) => { if (href === "/") return pathname === "/"; if (href.includes("#")) return false; // hash links handled separately return pathname === href; }; const closeMenu = () => setIsOpen(false); return ( <> {/* Modern Mobile Menu Drawer (slide-in, animated, high-contrast, touch-friendly) - high z to always appear in front of hero banner video etc. */} {isOpen && (
{/* Backdrop */} {/* Sliding Panel - modern, full-bleed on small phones, elegant on larger */} {/* Header */}
Shahi Kitchen
Shahi Kitchen
Gothenburg
{/* Primary Nav Links - modern list with icons + active state for visibility */}
{navLinks.map((link) => { const active = isActive(link.href); const Icon = link.href === '/' ? Home : link.href === '/menu' ? UtensilsCrossed : link.href === '/locations' ? MapPin : link.href.includes('experience') ? Star : Phone; return ( {link.label} {active && ( CURRENT )} ); })}
{/* Secondary actions + Language */}
LANGUAGE
{t.reserve}

Tap to open WhatsApp for orders & bookings

)}
); }