"use client"; import { PlayableCard } from "@/components/ui/PlayableCard"; import { Disc3 } from "lucide-react"; import { api } from "@/lib/api"; import type { Album } from "../types"; interface DiscographyProps { albums: Album[]; colors: any; onPlayAlbum: (albumId: string, albumTitle: string) => Promise; sortBy: "year" | "dateAdded"; onSortChange: (sortBy: "year" | "dateAdded") => void; } export function Discography({ albums, colors, onPlayAlbum, sortBy, onSortChange, }: DiscographyProps) { if (!albums || albums.length === 0) { return null; } return (

Discography

{/* Sort Dropdown */}
{albums.map((album, index) => { const subtitle = [ album.year, album.trackCount && `${album.trackCount} tracks`, ] .filter(Boolean) .join(" • "); return ( } badge="owned" circular={false} colors={colors} onPlay={() => onPlayAlbum(album.id, album.title)} tvCardIndex={index} /> ); })}
); }