'use client' import React, { useState } from 'react' import Link from 'next/link' import { useSelectedLayoutSegment } from 'next/navigation' import classNames from 'classnames' import { ArrowLeftIcon } from '@heroicons/react/24/solid' import type { INavSelectorProps } from './nav-selector' import NavSelector from './nav-selector' type INavProps = { icon: React.ReactNode text: string activeSegment: string | string[] link: string } & INavSelectorProps const Nav = ({ icon, text, activeSegment, link, curNav, navs, createText, onCreate, }: INavProps) => { const [hovered, setHovered] = useState(false) const segment = useSelectedLayoutSegment() const isActived = Array.isArray(activeSegment) ? activeSegment.includes(segment!) : segment === activeSegment return (