mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-20 22:36:27 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
66 lines
1.6 KiB
TypeScript
66 lines
1.6 KiB
TypeScript
"use client"
|
|
|
|
import { Fragment } from "react"
|
|
import Link from "next/link"
|
|
import { usePathname } from "next/navigation"
|
|
import { useBreadcrumb } from "fumadocs-core/breadcrumb"
|
|
import type { Root } from "fumadocs-core/page-tree"
|
|
|
|
import {
|
|
Breadcrumb,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbList,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
} from "@/registry/new-york-v4/ui/breadcrumb"
|
|
|
|
export function DocsBreadcrumb({
|
|
tree,
|
|
className,
|
|
}: {
|
|
tree: Root
|
|
className?: string
|
|
}) {
|
|
const pathname = usePathname()
|
|
const items = useBreadcrumb(pathname, tree)
|
|
|
|
if (items.length === 0) return null
|
|
|
|
return (
|
|
<Breadcrumb className={className}>
|
|
<BreadcrumbList>
|
|
<BreadcrumbItem>
|
|
<BreadcrumbLink asChild>
|
|
<Link href="/docs" className="hover:text-accent-foreground">
|
|
Docs
|
|
</Link>
|
|
</BreadcrumbLink>
|
|
</BreadcrumbItem>
|
|
<BreadcrumbSeparator />
|
|
{items.map((item, i) => (
|
|
<Fragment key={i}>
|
|
{i !== 0 && <BreadcrumbSeparator />}
|
|
{item.url ? (
|
|
<BreadcrumbItem>
|
|
<BreadcrumbLink asChild>
|
|
<Link
|
|
href={item.url}
|
|
className="hover:text-accent-foreground truncate"
|
|
>
|
|
{item.name}
|
|
</Link>
|
|
</BreadcrumbLink>
|
|
</BreadcrumbItem>
|
|
) : (
|
|
<BreadcrumbItem>
|
|
<BreadcrumbPage>{item.name}</BreadcrumbPage>
|
|
</BreadcrumbItem>
|
|
)}
|
|
</Fragment>
|
|
))}
|
|
</BreadcrumbList>
|
|
</Breadcrumb>
|
|
)
|
|
}
|