"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, LogIn } 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: "/login", label: t.nav.login }, { 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 ( <> {/* Top subtle gold line for extra frame separation */} {/* Premium Animated Logo */} Shahi Kitchen Shahi Taste • Gothenburg {/* Desktop Navigation - Premium Mesmerizing Design */} {navLinks.map((link, index) => { const active = isActive(link.href); return ( {link.label} {/* Sliding Active Indicator - Very Premium */} {active && ( )} {/* Mesmerizing Gold Underline on Hover */} ); })} {/* Desktop Actions — Stunning Mesmerizing Buttons */} {/* Cart Button - Elegant dark with gold accent */} {t.cart} {totalItems > 0 && ( {totalItems} )} {/* Reserve Table - The star of the nav, with mesmerizing gold gradient + shine */} {t.reserve} {/* Subtle shine sweep on hover */} {/* Mobile Hamburger + Cart (compact, high touch target) */} {/* MOBILE CART ICON (always visible) */} {totalItems > 0 && ( {totalItems} )} setIsOpen(!isOpen)} className="text-[#B38B4D] p-2 -mr-1 active:text-[#8C6B3A] transition-colors" aria-label="Toggle menu" aria-expanded={isOpen} > {/* 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 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 === '/login' ? LogIn : link.href.includes('experience') ? Star : Phone; return ( {link.label} {active && ( CURRENT )} ); })} {/* Secondary actions + Language */} LANGUAGE {t.reserve} { openCart(); closeMenu(); }} className="block w-full rounded-2xl border-2 border-[#c99a2e]/40 bg-white py-4 text-[15px] font-semibold text-[#101724] active:bg-[#F5F1E9] active:border-[#c99a2e] transition-all" > {t.cart} {totalItems > 0 && `(${totalItems})`} Tap to open WhatsApp for orders & bookings )} > ); }
Tap to open WhatsApp for orders & bookings