"use client"; import { useLayoutEffect } from "react"; import { gsap } from "gsap"; import { SplitText } from "gsap/SplitText"; import { Disclosure } from "@headlessui/react"; import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline"; import { Text } from "./typography/standard"; import { Grid } from "./containers/page-containers"; import { usePathname } from "next/navigation"; import { cn } from "../lib/utils"; import { Button } from "./ui/button"; import { Logo } from "./logo"; import { Badge } from "./ui/badge"; import { TrackLink } from "./trackable-components"; gsap.registerPlugin(SplitText); interface NavProps { property: string; subProperty?: string; navigation: { name: string; href: string; emphasized?: boolean }[]; } export const Nav = ({ property, subProperty, navigation }: NavProps) => { useLayoutEffect(() => {}, []); const pathname = usePathname(); return ( {({ open }) => ( <>
{property !== "fiveonefour" ? ( alpha ) : null}
{navigation.map((item) => { const isActive = pathname.startsWith(item.href); return (
{item.emphasized ? ( ) : ( {item.name} )}
); })}
{/* Mobile menu button */} Open main menu {open ? (
{navigation.map((item) => { const isActive = pathname.startsWith(item.href); return ( {item.name} ); })}
)}
); };