"use client"; import { useId, useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { ChevronDownIcon, CloseIcon } from "@iconicicons/react"; import { Badge, Button } from "@lemonsqueezy/wedges"; import { type NavItem } from "@/types/nav"; import { sidebarConfig, type DocsConfig } from "@/config/sidebarConfig"; import { siteConfig } from "@/config/siteConfig"; import { cn } from "@/lib/utils"; import { useSidebar } from "./Providers"; import { ScrollArea } from "./ScrollArea"; export function Sidebar() { const sidebarNav = sidebarConfig.nav; const { isSidebarOpen, toggleSidebar } = useSidebar(); return ( ); } type SidebarNavProps = { items: NavItem[]; }; function SidebarNav({ items }: SidebarNavProps) { const pathname = usePathname(); const id = useId(); if (!items.length) { return null; } return ( ); } function SidebarDropdown({ item, pathname }: { item: NavItem; pathname?: string }) { const toggle = () => { setIsOpen(!isOpen); }; const [isOpen, setIsOpen] = useState(true); return (

{item.label}

{isOpen ? : null}
); } function SidebarDropdownItems({ items, pathname, }: { items?: DocsConfig["nav"]; pathname?: string; }) { const id = useId(); const { toggleSidebar } = useSidebar(); if (!items) { return null; } if (!items.length) { return null; } return (
{items.map((item, index) => item.href && !item.disabled ? ( {item.label} {item.new ? ( New ) : null} ) : ( {item.label} In progress ) )}
); }