'use client' import { useState } from 'react' import Link from 'next/link' import Image from 'next/image' import { usePathname, useRouter } from 'next/navigation' import { Menu, X } from 'lucide-react' import { getDictionary, type Locale } from '@/lib/i18n' export default function Header({ lang }: { lang: string }) { const [menuOpen, setMenuOpen] = useState(false) const pathname = usePathname() const router = useRouter() const d = getDictionary(lang) const links = [ { label: d.nav.services, href: `/${lang}/uslugi/` }, { label: d.nav.about, href: `/${lang}/o-kompanii/` }, { label: d.nav.faq, href: `/${lang}/faq/` }, ] function toggleLang() { const newLang = lang === 'ru' ? 'en' : 'ru' const newPath = pathname.replace(`/${lang}`, `/${newLang}`) router.push(newPath) } return (
Сисадмингрупп
{menuOpen && (
{links.map(l => ( setMenuOpen(false)} className="text-sm font-medium text-slate-700 hover:text-blue-700"> {l.label} ))} setMenuOpen(false)} className="text-sm font-medium text-blue-700"> {d.nav.contact}
)}
) }