import { useNavigate } from "react-router-dom"; import { Music, Disc3, Mic2 } from "lucide-react"; interface ArtistContributionDTO { musicalEntityId: number; title: string; role: string; entityType: string; } interface ArtistViewProps { contributions: ArtistContributionDTO[]; } 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 Section */} {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.role.replace("_", " ")}
))}
)} {contributions.length === 0 && (

No contributions yet

Start creating music to see it here

)}
); }; export default ArtistView;