"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Menu, X } from "lucide-react"; import { motion } from "framer-motion"; import { useTranslations } from "next-intl"; interface NavLink { id: string; labelKey: string; href: string; } interface NavbarProps { logoText?: string; } export function Navbar({ logoText = "FIRMA" }: NavbarProps) { const [isOpen, setIsOpen] = useState(false); const t = useTranslations(); const pathname = usePathname(); const navLinks: NavLink[] = [ { id: "about", labelKey: "nav.about", href: "#about" }, { id: "products", labelKey: "nav.products", href: "#products" }, { id: "faq", labelKey: "nav.faq", href: "#faq" }, { id: "contact", labelKey: "nav.contact", href: "#contact" }, ]; const locale = pathname.split("/")[1]; const otherLocale = locale === "uz" ? "ru" : "uz"; const otherPath = pathname.replace(`/${locale}`, `/${otherLocale}`); const handleScroll = (href: string) => { if (href.startsWith("#")) { const element = document.querySelector(href); if (element) { element.scrollIntoView({ behavior: "smooth" }); } } setIsOpen(false); }; return ( ); }