"use client" import Link from "next/link" import { usePathname } from "next/navigation" import { cn } from "@/lib/utils" import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area" const examples = [ { name: "Mail", href: "/examples/mail", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/mail", hidden: false, }, { name: "Dashboard", href: "/examples/dashboard", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/dashboard", hidden: false, }, { name: "Tasks", href: "/examples/tasks", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/tasks", hidden: false, }, { name: "Playground", href: "/examples/playground", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/playground", hidden: false, }, { name: "Forms", href: "/examples/forms", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/forms", hidden: false, }, { name: "Music", href: "/examples/music", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/music", hidden: false, }, { name: "Authentication", href: "/examples/authentication", code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/authentication", hidden: false, }, ] interface ExamplesNavProps extends React.HTMLAttributes {} export function ExamplesNav({ className, ...props }: ExamplesNavProps) { const pathname = usePathname() return (
{examples.map((example) => ( ))}
) } function ExampleLink({ example, isActive, }: { example: (typeof examples)[number] isActive: boolean }) { if (example.hidden) { return null } return ( {example.name} ) }