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

nav-favorites.tsx — ui Source File

Architecture documentation for nav-favorites.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
  3cb61fb2_aa22_cde1_90a2_59e5ce0a2269["nav-favorites.tsx"]
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  3cb61fb2_aa22_cde1_90a2_59e5ce0a2269 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  d1cb37f2_0d1d_01bc_0d60_a15219afac51["dropdown-menu"]
  3cb61fb2_aa22_cde1_90a2_59e5ce0a2269 --> d1cb37f2_0d1d_01bc_0d60_a15219afac51
  12632a83_ef01_5f03_4110_ed33d49893b7["sidebar"]
  3cb61fb2_aa22_cde1_90a2_59e5ce0a2269 --> 12632a83_ef01_5f03_4110_ed33d49893b7
  style 3cb61fb2_aa22_cde1_90a2_59e5ce0a2269 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import {
  ArrowUpRight,
  Link,
  MoreHorizontal,
  StarOff,
  Trash2,
} from "lucide-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 NavFavorites({
  favorites,
}: {
  favorites: {
    name: string
    url: string
    emoji: string
  }[]
}) {
  const { isMobile } = useSidebar()

  return (
    <SidebarGroup className="group-data-[collapsible=icon]:hidden">
      <SidebarGroupLabel>Favorites</SidebarGroupLabel>
      <SidebarMenu>
        {favorites.map((item) => (
          <SidebarMenuItem key={item.name}>
            <SidebarMenuButton asChild>
              <a href={item.url} title={item.name}>
                <span>{item.emoji}</span>
                <span>{item.name}</span>
              </a>
            </SidebarMenuButton>
            <DropdownMenu>
              <DropdownMenuTrigger asChild>
                <SidebarMenuAction showOnHover>
                  <MoreHorizontal />
                  <span className="sr-only">More</span>
                </SidebarMenuAction>
              </DropdownMenuTrigger>
              <DropdownMenuContent
                className="w-56 rounded-lg"
                side={isMobile ? "bottom" : "right"}
                align={isMobile ? "end" : "start"}
              >
                <DropdownMenuItem>
                  <StarOff className="text-muted-foreground" />
                  <span>Remove from Favorites</span>
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem>
                  <Link className="text-muted-foreground" />
                  <span>Copy Link</span>
                </DropdownMenuItem>
                <DropdownMenuItem>
                  <ArrowUpRight className="text-muted-foreground" />
                  <span>Open in New Tab</span>
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem>
                  <Trash2 className="text-muted-foreground" />
                  <span>Delete</span>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </SidebarMenuItem>
        ))}
        <SidebarMenuItem>
          <SidebarMenuButton className="text-sidebar-foreground/70">
            <MoreHorizontal />
            <span>More</span>
          </SidebarMenuButton>
        </SidebarMenuItem>
      </SidebarMenu>
    </SidebarGroup>
  )
}

Subdomains

Functions

Dependencies

  • dropdown-menu
  • lucide-react
  • sidebar

Frequently Asked Questions

What does nav-favorites.tsx do?
nav-favorites.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-favorites.tsx?
nav-favorites.tsx defines 1 function(s): NavFavorites.
What does nav-favorites.tsx depend on?
nav-favorites.tsx imports 3 module(s): dropdown-menu, lucide-react, sidebar.
Where is nav-favorites.tsx in the architecture?
nav-favorites.tsx is located at apps/v4/registry/new-york-v4/blocks/sidebar-10/components/nav-favorites.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/blocks/sidebar-10/components).

Analyze Your Own Codebase

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

Try Supermodel Free