'use client'; import { useMemo, useState } from 'react'; import Link from 'next/link'; import { HomeModernIcon, Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline'; import { AnimatePresence, m, LazyMotion, domAnimation } from "framer-motion"; import { usePathname } from 'next/navigation'; import ThemeSwitcher from './theme-switcher'; type NavBarClientProps = { LogIn: React.JSX.Element, navigation: { name: string; href: string; current: boolean; }[] } export default function NavBarClient({LogIn, navigation}: NavBarClientProps): React.JSX.Element { const [open, setOpen] = useState(false); const pathname = usePathname(); const activeNavigation = useMemo((): typeof navigation => { const nav = structuredClone(navigation); const current = nav.find((nav) => nav.href === pathname); if (current) { current.current = true; } return nav; }, [pathname]); return ( ); }