album-artwork.tsx — ui Source File
Architecture documentation for album-artwork.tsx, a tsx file in the ui codebase. 7 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR c131b0f2_30cc_26c0_60da_6ff8d0a57400["album-artwork.tsx"] 4ce849f6_3650_d3c5_9f5f_a21c173777bc["albums.ts"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> 4ce849f6_3650_d3c5_9f5f_a21c173777bc c0fdd13f_1a07_8886_0d97_2f108bb65d5e["Album"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> c0fdd13f_1a07_8886_0d97_2f108bb65d5e 163e8432_9f96_406b_3feb_33518ea942ea["playlists.ts"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> 163e8432_9f96_406b_3feb_33518ea942ea 3eb36dd7_f51a_1431_02e2_7abafe315718["image"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> 3eb36dd7_f51a_1431_02e2_7abafe315718 d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81 c2733a6e_d62e_55f8_0265_d4e0d04a05ef["context-menu"] c131b0f2_30cc_26c0_60da_6ff8d0a57400 --> c2733a6e_d62e_55f8_0265_d4e0d04a05ef 054ca25e_f665_64b0_351d_ed2a653946c8["page.tsx"] 054ca25e_f665_64b0_351d_ed2a653946c8 --> c131b0f2_30cc_26c0_60da_6ff8d0a57400 style c131b0f2_30cc_26c0_60da_6ff8d0a57400 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Image from "next/image"
import { PlusCircle } from "lucide-react"
import { cn } from "@/lib/utils"
import {
ContextMenu,
ContextMenuContent,
ContextMenuItem,
ContextMenuSeparator,
ContextMenuSub,
ContextMenuSubContent,
ContextMenuSubTrigger,
ContextMenuTrigger,
} from "@/registry/new-york/ui/context-menu"
import { Album } from "../data/albums"
import { playlists } from "../data/playlists"
interface AlbumArtworkProps extends React.HTMLAttributes<HTMLDivElement> {
album: Album
aspectRatio?: "portrait" | "square"
width?: number
height?: number
}
export function AlbumArtwork({
album,
aspectRatio = "portrait",
width,
height,
className,
...props
}: AlbumArtworkProps) {
return (
<div className={cn("space-y-3", className)} {...props}>
<ContextMenu>
<ContextMenuTrigger>
<div className="overflow-hidden rounded-md">
<Image
src={album.cover}
alt={album.name}
width={width}
height={height}
className={cn(
"h-auto w-auto object-cover transition-all hover:scale-105",
aspectRatio === "portrait" ? "aspect-[3/4]" : "aspect-square"
)}
/>
</div>
</ContextMenuTrigger>
<ContextMenuContent className="w-40">
<ContextMenuItem>Add to Library</ContextMenuItem>
<ContextMenuSub>
<ContextMenuSubTrigger>Add to Playlist</ContextMenuSubTrigger>
<ContextMenuSubContent className="w-48">
<ContextMenuItem>
<PlusCircle className="mr-2 h-4 w-4" />
New Playlist
</ContextMenuItem>
<ContextMenuSeparator />
{playlists.map((playlist) => (
<ContextMenuItem key={playlist}>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="mr-2 h-4 w-4"
viewBox="0 0 24 24"
>
<path d="M21 15V6M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM12 12H3M16 6H3M12 18H3" />
</svg>
{playlist}
</ContextMenuItem>
))}
</ContextMenuSubContent>
</ContextMenuSub>
<ContextMenuSeparator />
<ContextMenuItem>Play Next</ContextMenuItem>
<ContextMenuItem>Play Later</ContextMenuItem>
<ContextMenuItem>Create Station</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem>Like</ContextMenuItem>
<ContextMenuItem>Share</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>
<div className="space-y-1 text-sm">
<h3 className="font-medium leading-none">{album.name}</h3>
<p className="text-xs text-muted-foreground">{album.artist}</p>
</div>
</div>
)
}
Domain
Subdomains
Functions
Types
Dependencies
- Album
- albums.ts
- context-menu
- image
- lucide-react
- playlists.ts
- utils
Imported By
Source
Frequently Asked Questions
What does album-artwork.tsx do?
album-artwork.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in album-artwork.tsx?
album-artwork.tsx defines 1 function(s): AlbumArtwork.
What does album-artwork.tsx depend on?
album-artwork.tsx imports 7 module(s): Album, albums.ts, context-menu, image, lucide-react, playlists.ts, utils.
What files import album-artwork.tsx?
album-artwork.tsx is imported by 1 file(s): page.tsx.
Where is album-artwork.tsx in the architecture?
album-artwork.tsx is located at deprecated/www/app/(app)/examples/music/components/album-artwork.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: deprecated/www/app/(app)/examples/music/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free