"use client"; import Link from "next/link"; import { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Menu, X, ArrowRight } from "lucide-react"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; import type { Locale, Dictionary } from "@/lib/dictionaries"; import LanguageSwitcher from "@/components/ui/LanguageSwitcher"; import IPInfoCard from "@/components/ui/IPInfoCard"; import { LogoMark } from "@/components/ui/Logo"; interface NavbarProps { locale: Locale; dict: Dictionary; } export default function Navbar({ locale, dict }: NavbarProps) { const [scrolled, setScrolled] = useState(false); const [open, setOpen] = useState(false); const pathname = usePathname(); const navLinks = [ { href: `/${locale}/#features`, label: dict.nav.features }, { href: `/${locale}/projects`, label: dict.nav.projects }, { href: `/${locale}/services`, label: dict.nav.services }, { href: `/${locale}/about`, label: dict.nav.about }, ]; useEffect(() => { const handler = () => setScrolled(window.scrollY > 12); handler(); window.addEventListener("scroll", handler, { passive: true }); return () => window.removeEventListener("scroll", handler); }, []); useEffect(() => { document.body.style.overflow = open ? "hidden" : ""; return () => { document.body.style.overflow = ""; }; }, [open]); return ( <> {/* Mobile menu */} {open && (
{navLinks.map((link, i) => ( setOpen(false)} className="font-display text-3xl font-medium tracking-tight text-text-primary transition-colors hover:text-purple-300" > {link.label} ))} setOpen(false)} className="group inline-flex items-center gap-2 rounded-xl bg-gradient-to-r from-purple-300 via-purple-500 to-purple-700 px-6 py-3 font-display text-lg font-medium text-white shadow-glow-lg" > {dict.nav.contact}
)}
); }