mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +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.
77 lines
2.0 KiB
TypeScript
77 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuItem,
|
|
DropdownMenuTrigger,
|
|
} from "@/registry/bases/base/ui/dropdown-menu"
|
|
import {
|
|
SidebarGroup,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem,
|
|
useSidebar,
|
|
} from "@/registry/bases/base/ui/sidebar"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
export function NavMain({
|
|
items,
|
|
}: {
|
|
items: {
|
|
title: string
|
|
url: string
|
|
icon?: React.ReactNode
|
|
isActive?: boolean
|
|
items?: {
|
|
title: string
|
|
url: string
|
|
}[]
|
|
}[]
|
|
}) {
|
|
const { isMobile } = useSidebar()
|
|
return (
|
|
<SidebarGroup>
|
|
<SidebarMenu>
|
|
{items.map((item) => (
|
|
<DropdownMenu key={item.title}>
|
|
<SidebarMenuItem>
|
|
<DropdownMenuTrigger
|
|
render={
|
|
<SidebarMenuButton className="aria-expanded:bg-muted" />
|
|
}
|
|
>
|
|
{item.title}{" "}
|
|
<IconPlaceholder
|
|
lucide="MoreHorizontalIcon"
|
|
tabler="IconDots"
|
|
hugeicons="MoreHorizontalCircle01Icon"
|
|
phosphor="DotsThreeOutlineIcon"
|
|
remixicon="RiMoreLine"
|
|
className="ml-auto"
|
|
/>
|
|
</DropdownMenuTrigger>
|
|
{item.items?.length ? (
|
|
<DropdownMenuContent
|
|
side={isMobile ? "bottom" : "right"}
|
|
align={isMobile ? "end" : "start"}
|
|
className="min-w-56 rounded-lg"
|
|
>
|
|
{item.items.map((item) => (
|
|
<DropdownMenuItem
|
|
key={item.title}
|
|
render={<a href={item.url} />}
|
|
>
|
|
{item.title}
|
|
</DropdownMenuItem>
|
|
))}
|
|
</DropdownMenuContent>
|
|
) : null}
|
|
</SidebarMenuItem>
|
|
</DropdownMenu>
|
|
))}
|
|
</SidebarMenu>
|
|
</SidebarGroup>
|
|
)
|
|
}
|