main
|
Last change
on this file since fd81a18 was fd81a18, checked in by Dimitar Arsov <dimitararsov04@…>, 6 months ago |
|
add playlists to user profile
|
-
Property mode
set to
100644
|
|
File size:
1.7 KB
|
| Rev | Line | |
|---|
| [fd81a18] | 1 | import { useNavigate } from "react-router-dom";
|
|---|
| 2 |
|
|---|
| 3 | interface ArtistContributionDTO {
|
|---|
| 4 | musicalEntityId: number;
|
|---|
| 5 | title: string;
|
|---|
| 6 | role: string;
|
|---|
| 7 | entityType: string;
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | interface ArtistViewProps {
|
|---|
| 11 | contributions: ArtistContributionDTO[];
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | const ArtistView = ({ contributions }: ArtistViewProps) => {
|
|---|
| 15 | const navigate = useNavigate();
|
|---|
| 16 |
|
|---|
| 17 | return (
|
|---|
| 18 | <div className="mt-8 border-t pt-6">
|
|---|
| 19 | <h2 className="text-2xl font-bold mb-4">Contributions</h2>
|
|---|
| 20 | <div className="grid gap-3">
|
|---|
| 21 | {contributions.map((contribution, index) => (
|
|---|
| 22 | <div
|
|---|
| 23 | key={index}
|
|---|
| 24 | className="p-4 border rounded hover:shadow-md transition-shadow cursor-pointer"
|
|---|
| 25 | onClick={() =>
|
|---|
| 26 | navigate(`/musical-entity/${contribution.musicalEntityId}`)
|
|---|
| 27 | }
|
|---|
| 28 | >
|
|---|
| 29 | <div className="flex justify-between items-center">
|
|---|
| 30 | <div className="flex-1">
|
|---|
| 31 | <p className="font-semibold text-lg">{contribution.title}</p>
|
|---|
| 32 | <p className="text-sm text-gray-500 mt-1">
|
|---|
| 33 | ID: {contribution.musicalEntityId}
|
|---|
| 34 | </p>
|
|---|
| 35 | </div>
|
|---|
| 36 | <div className="flex gap-2">
|
|---|
| 37 | <span className="bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm font-medium">
|
|---|
| 38 | {contribution.role}
|
|---|
| 39 | </span>
|
|---|
| 40 | <span className="bg-gray-100 text-gray-800 px-3 py-1 rounded-full text-sm font-medium">
|
|---|
| 41 | {contribution.entityType}
|
|---|
| 42 | </span>
|
|---|
| 43 | </div>
|
|---|
| 44 | </div>
|
|---|
| 45 | </div>
|
|---|
| 46 | ))}
|
|---|
| 47 | </div>
|
|---|
| 48 | {contributions.length === 0 && (
|
|---|
| 49 | <p className="text-gray-500 text-center py-4">No contributions yet</p>
|
|---|
| 50 | )}
|
|---|
| 51 | </div>
|
|---|
| 52 | );
|
|---|
| 53 | };
|
|---|
| 54 |
|
|---|
| 55 | export default ArtistView;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.