Home / File/ nav-documents.tsx — ui Source File

nav-documents.tsx — ui Source File

Architecture documentation for nav-documents.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  b51cfec1_c5f2_14a8_f0d5_b483bacf29a2["nav-documents.tsx"]
  39a0d62e_8e7d_d097_eb95_91d2bca361f7["icons-react"]
  b51cfec1_c5f2_14a8_f0d5_b483bacf29a2 --> 39a0d62e_8e7d_d097_eb95_91d2bca361f7
  d1cb37f2_0d1d_01bc_0d60_a15219afac51["dropdown-menu"]
  b51cfec1_c5f2_14a8_f0d5_b483bacf29a2 --> d1cb37f2_0d1d_01bc_0d60_a15219afac51
  12632a83_ef01_5f03_4110_ed33d49893b7["sidebar"]
  b51cfec1_c5f2_14a8_f0d5_b483bacf29a2 --> 12632a83_ef01_5f03_4110_ed33d49893b7
  style b51cfec1_c5f2_14a8_f0d5_b483bacf29a2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import {
  IconDots,
  IconFolder,
  IconShare3,
  IconTrash,
  type Icon,
} from "@tabler/icons-react"

import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
} from "@/registry/new-york-v4/ui/dropdown-menu"
import {
  SidebarGroup,
  SidebarGroupLabel,
  SidebarMenu,
  SidebarMenuAction,
  SidebarMenuButton,
  SidebarMenuItem,
  useSidebar,
} from "@/registry/new-york-v4/ui/sidebar"

export function NavDocuments({
  items,
}: {
  items: {
    name: string
    url: string
    icon: Icon
  }[]
}) {
  const { isMobile } = useSidebar()

  return (
    <SidebarGroup className="group-data-[collapsible=icon]:hidden">
      <SidebarGroupLabel>Documents</SidebarGroupLabel>
      <SidebarMenu>
        {items.map((item) => (
          <SidebarMenuItem key={item.name}>
            <SidebarMenuButton asChild>
              <a href={item.url}>
                <item.icon />
                <span>{item.name}</span>
              </a>
            </SidebarMenuButton>
            <DropdownMenu>
              <DropdownMenuTrigger asChild>
                <SidebarMenuAction
                  showOnHover
                  className="data-[state=open]:bg-accent rounded-sm"
                >
                  <IconDots />
                  <span className="sr-only">More</span>
                </SidebarMenuAction>
              </DropdownMenuTrigger>
              <DropdownMenuContent
                className="w-24 rounded-lg"
                side={isMobile ? "bottom" : "right"}
                align={isMobile ? "end" : "start"}
              >
                <DropdownMenuItem>
                  <IconFolder />
                  <span>Open</span>
                </DropdownMenuItem>
                <DropdownMenuItem>
                  <IconShare3 />
                  <span>Share</span>
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem variant="destructive">
                  <IconTrash />
                  <span>Delete</span>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </SidebarMenuItem>
        ))}
        <SidebarMenuItem>
          <SidebarMenuButton className="text-sidebar-foreground/70">
            <IconDots className="text-sidebar-foreground/70" />
            <span>More</span>
          </SidebarMenuButton>
        </SidebarMenuItem>
      </SidebarMenu>
    </SidebarGroup>
  )
}

Subdomains

Functions

Dependencies

  • dropdown-menu
  • icons-react
  • sidebar

Frequently Asked Questions

What does nav-documents.tsx do?
nav-documents.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in nav-documents.tsx?
nav-documents.tsx defines 1 function(s): NavDocuments.
What does nav-documents.tsx depend on?
nav-documents.tsx imports 3 module(s): dropdown-menu, icons-react, sidebar.
Where is nav-documents.tsx in the architecture?
nav-documents.tsx is located at apps/v4/registry/new-york-v4/blocks/dashboard-01/components/nav-documents.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/blocks/dashboard-01/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free