"use client"; import Link from "next/link"; import { Menu, X, Send, MessageCircle, Phone } from "lucide-react"; import { useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import { createPortal } from "react-dom"; type NavLink = { href: string; label: string; }; export default function MobileMenu({ navLinks, }: { navLinks: NavLink[]; }) { const [mobileOpen, setMobileOpen] = useState(false); const pathname = usePathname(); const canUsePortal = typeof window !== "undefined"; useEffect(() => { if (mobileOpen) { document.body.style.overflow = "hidden"; document.documentElement.style.overflow = "hidden"; } else { document.body.style.overflow = ""; document.documentElement.style.overflow = ""; } return () => { document.body.style.overflow = ""; document.documentElement.style.overflow = ""; }; }, [mobileOpen]); return ( <> {canUsePortal && mobileOpen && createPortal(
WorkParking
Smart entry systems
setMobileOpen(false)} className="mb-6 flex w-full items-center justify-center gap-2 rounded-2xl bg-emerald-600 px-4 py-4 text-sm font-semibold text-white transition-colors hover:bg-emerald-500" > Связаться с нами
Мы в сети
ООО «Пракфлоу» • ИНН 7777773333
, document.body, )} ); }