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

nav-projects.tsx — ui Source File

Architecture documentation for nav-projects.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
  25f759cb_2b08_faed_212e_ab4c9bb68420["nav-projects.tsx"]
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  25f759cb_2b08_faed_212e_ab4c9bb68420 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  f16f43cb_04fd_5f33_2140_7eafce119350["dropdown-menu"]
  25f759cb_2b08_faed_212e_ab4c9bb68420 --> f16f43cb_04fd_5f33_2140_7eafce119350
  742f06fb_c1e8_243e_1fc4_8b1cf11704c2["sidebar"]
  25f759cb_2b08_faed_212e_ab4c9bb68420 --> 742f06fb_c1e8_243e_1fc4_8b1cf11704c2
  style 25f759cb_2b08_faed_212e_ab4c9bb68420 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import {
  Folder,
  Forward,
  MoreHorizontal,
  Trash2,
  type LucideIcon,
} from "lucide-react"

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

export function NavProjects({
  projects,
}: {
  projects: {
    name: string
    url: string
    icon: LucideIcon
  }[]
}) {
  const { isMobile } = useSidebar()

  return (
    <SidebarGroup className="group-data-[collapsible=icon]:hidden">
      <SidebarGroupLabel>Projects</SidebarGroupLabel>
      <SidebarMenu>
        {projects.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>
                  <MoreHorizontal />
                  <span className="sr-only">More</span>
                </SidebarMenuAction>
              </DropdownMenuTrigger>
              <DropdownMenuContent
                className="w-48 rounded-lg"
                side={isMobile ? "bottom" : "right"}
                align={isMobile ? "end" : "start"}
              >
                <DropdownMenuItem>
                  <Folder className="text-muted-foreground" />
                  <span>View Project</span>
                </DropdownMenuItem>
                <DropdownMenuItem>
                  <Forward className="text-muted-foreground" />
                  <span>Share Project</span>
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem>
                  <Trash2 className="text-muted-foreground" />
                  <span>Delete Project</span>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </SidebarMenuItem>
        ))}
        <SidebarMenuItem>
          <SidebarMenuButton className="text-sidebar-foreground/70">
            <MoreHorizontal className="text-sidebar-foreground/70" />
            <span>More</span>
          </SidebarMenuButton>
        </SidebarMenuItem>
      </SidebarMenu>
    </SidebarGroup>
  )
}

Subdomains

Functions

Dependencies

  • dropdown-menu
  • lucide-react
  • sidebar

Frequently Asked Questions

What does nav-projects.tsx do?
nav-projects.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-projects.tsx?
nav-projects.tsx defines 1 function(s): NavProjects.
What does nav-projects.tsx depend on?
nav-projects.tsx imports 3 module(s): dropdown-menu, lucide-react, sidebar.
Where is nav-projects.tsx in the architecture?
nav-projects.tsx is located at deprecated/www/registry/default/blocks/sidebar-07/components/nav-projects.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/blocks/sidebar-07/components).

Analyze Your Own Codebase

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

Try Supermodel Free