"use client"; import { Music } from "lucide-react"; import Image from "next/image"; import { Artist, ArtistSource, Album } from "../types"; import { ReactNode, lazy, Suspense } from "react"; import { useArtistDisplayData } from "@/hooks/useMetadataDisplay"; // Lazy load MetadataEditor - modal component opened on user action const MetadataEditor = lazy(() => import("@/components/MetadataEditor").then(mod => ({ default: mod.MetadataEditor }))); interface ArtistHeroProps { artist: Artist; source: ArtistSource; albums: Album[]; heroImage: string | null; colors: any; onReload: () => void; children?: ReactNode; } export function ArtistHero({ artist, source, albums, heroImage, colors, onReload, children, }: ArtistHeroProps) { const displayData = useArtistDisplayData(artist); const ownedAlbums = albums.filter((a) => a.owned); return (
{/* Background Image with VibrantJS gradient */} {heroImage ? (
{displayData.name}
{/* Dynamic VibrantJS gradient overlays */}
) : (
)} {/* Compact Hero Content - Full Width */}
{/* Artist Image - Circular */}
{heroImage ? ( {displayData.name} ) : (
)}
{/* Artist Info - Bottom Aligned */}

Artist

{displayData.name}

{displayData.hasUserOverrides && ( Edited )} {source === "library" && ( { await onReload(); }} /> )}
{artist.listeners && artist.listeners > 0 && ( <> {artist.listeners.toLocaleString()}{" "} listeners )} {albums.length > 0 && ( <> {albums.length} albums {ownedAlbums.length > 0 && ( <> {ownedAlbums.length} owned )} )}
{/* Action Bar - Full Width */} {children && (
{children}
)}
); }