"use client" import Link from "next/link" import { usePathname } from "next/navigation" import type { source } from "@/lib/source" import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from "@/registry/new-york-v4/ui/sidebar" export function DocsSidebar({ tree, ...props }: React.ComponentProps & { tree: typeof source.pageTree }) { const pathname = usePathname() return (
{tree.children.map((item) => ( {item.name} {item.type === "folder" && ( {item.children.map((item) => { return ( item.type === "page" && ( {item.name} ) ) })} )} ))} ) }