'use client'
import { useEffect, useState } from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { ArrowLeftIcon, MenuIcon, XIcon } from 'lucide-react'
import BlurEffect from 'react-progressive-blur'
import { AnimateIn, StandardSiteLogo } from '@/app/components'
import { DOCS_NAV } from '@/app/data/docs-nav'
export function DocsNav() {
const [isOpen, setIsOpen] = useState(false)
const pathname = usePathname()
const [prevPathname, setPrevPathname] = useState(pathname)
// Close menu when route changes (adjusting state during render)
if (pathname !== prevPathname) {
setPrevPathname(pathname)
setIsOpen(false)
}
useEffect(() => {
if (isOpen) {
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = ''
}
return () => {
document.body.style.overflow = ''
}
}, [isOpen])
return (
<>