"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { SidebarNavItem } from "types/nav"
import { type DocsConfig } from "@/config/docs"
import { cn } from "@/lib/utils"
export function DocsNav({ config }: { config: DocsConfig }) {
const pathname = usePathname()
const items = config.sidebarNav
return items.length ? (
{items.map((item, index) => (
{item.title}{" "}
{item.label && (
{item.label}
)}
{item?.items?.length && (
)}
))}
) : null
}
function DocsNavItems({
items,
pathname,
}: {
items: SidebarNavItem[]
pathname: string | null
}) {
return items?.length ? (
{items.map((item, index) =>
item.href && !item.disabled ? (
{item.title}
{item.label && (
{item.label}
)}
) : (
{item.title}
{item.label && (
{item.label}
)}
)
)}
) : null
}