/* eslint-disable @next/next/no-img-element */ import { useEffect, useState } from 'react' import { useRouter } from 'next/router' import { cn } from '@/lib/utils' import { FaDiscord, FaGithub } from 'react-icons/fa' import { FiDownload } from 'react-icons/fi' import { FaXTwitter, FaLinkedinIn } from 'react-icons/fa6' import { Button } from './ui/button' import LogoJanSVG from '@/assets/icons/logo-jan.svg' const MENU_ITEMS = [ { name: 'Docs', href: '/docs' }, { name: 'Changelog', href: '/changelog' }, { name: 'Blog', href: '/blog' }, { name: 'Handbook', href: '/handbook' }, ] const Navbar = ({ noScroll }: { noScroll?: boolean }) => { const router = useRouter() const [isScrolled, setIsScrolled] = useState(false) const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false) const currentPath = router.asPath const isLanding = currentPath === '/' useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > (isLanding ? 76 : 0)) } window.addEventListener('scroll', handleScroll) return () => window.removeEventListener('scroll', handleScroll) }, [isLanding]) const toggleMobileMenu = () => { setIsMobileMenuOpen(!isMobileMenuOpen) } // Prevent body scroll when mobile menu is open useEffect(() => { if (isMobileMenuOpen) { document.body.style.overflow = 'hidden' } else { document.body.style.overflow = 'unset' } // Cleanup on unmount return () => { document.body.style.overflow = 'unset' } }, [isMobileMenuOpen]) return (