import { useNavigate } from "react-router-dom"; import { Music, Disc3 } from "lucide-react"; import type { ArtistContribution } from "../../utils/types"; interface ArtistViewProps { contributions: ArtistContribution[]; } const ArtistView = ({ contributions }: ArtistViewProps) => { const navigate = useNavigate(); const albums = contributions.filter((c) => c.entityType === "ALBUM"); const songs = contributions.filter((c) => c.entityType === "SONG"); const getRoleColor = (role: string) => { const colors: { [key: string]: string } = { COMPOSER: "bg-purple-500", PERFORMER: "bg-blue-500", PRODUCER: "bg-green-500", MAIN_VOCAL: "bg-pink-500", }; return colors[role] || "bg-gray-500"; }; return (
{albums.length > 0 && (

Albums

{albums.map((album, index) => (
navigate(`/musical-entity/${album.musicalEntityId}`) } >
{album.role.replace("_", " ")}

{album.title}

))}
)} {songs.length > 0 && (

Songs

{songs.map((song, index) => (
navigate(`/musical-entity/${song.musicalEntityId}`) } >

{song.title}

{song.genre}
{song.role.replace("_", " ")}
))}
)} {contributions.length === 0 && (

No contributions yet

Start creating music to see it here

)}
); }; export default ArtistView;