Ignore:
Timestamp:
01/30/26 00:08:04 (5 months ago)
Author:
Dimitar Arsov <dimitararsov04@…>
Branches:
main
Children:
2b08bed
Parents:
6de2873
Message:

refactor NonAdminUser dtos

Location:
frontend/src/components/userProfile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/components/userProfile/ArtistView.tsx

    r6de2873 r98992cf  
    11import { useNavigate } from "react-router-dom";
    22import { Music, Disc3 } from "lucide-react";
    3 import type { ArtistContributionDTO } from "../../utils/types";
     3import type { ArtistContribution } from "../../utils/types";
    44
    55interface ArtistViewProps {
    6   contributions: ArtistContributionDTO[];
     6  contributions: ArtistContribution[];
    77}
    88
  • frontend/src/components/userProfile/ListenerView.tsx

    r6de2873 r98992cf  
    11import { useNavigate } from "react-router-dom";
    22import { Heart, ListMusic, Music, Album } from "lucide-react";
    3 import type { Playlist, MusicalEntityDTO } from "../../utils/types";
     3import type { Playlist, MusicalEntity } from "../../utils/types";
    44
    55interface ListenerViewProps {
    6   likedEntities: MusicalEntityDTO[];
    7   playlists?: Playlist[];
     6  likedEntities: MusicalEntity[] | [];
     7  playlists: Playlist[] | [];
    88}
    99
     
    1111  const navigate = useNavigate();
    1212
    13   const likedSongs = likedEntities.filter((e) => e.type === "SONG");
    14   const likedAlbums = likedEntities.filter((e) => e.type === "ALBUM");
     13  const likedSongs = likedEntities?.filter((e) => e.type === "SONG");
     14  const likedAlbums = likedEntities?.filter((e) => e.type === "ALBUM");
    1515
    1616  return (
     
    5555      )}
    5656
    57       {likedSongs.length > 0 && (
     57      {likedSongs && likedSongs.length > 0 && (
    5858        <section>
    5959          <div className="flex items-center gap-2 mb-6 pb-2 border-b-2 border-gray-200">
     
    6161            <h3 className="text-2xl font-bold text-gray-800">Liked Songs</h3>
    6262            <span className="text-sm text-gray-400 ml-1">
    63               ({likedSongs.length})
     63              ({likedSongs?.length})
    6464            </span>
    6565          </div>
     
    9090      )}
    9191
    92       {likedAlbums.length > 0 && (
     92      {likedAlbums && likedAlbums.length > 0 && (
    9393        <section>
    9494          <div className="flex items-center gap-2 mb-6 pb-2 border-b-2 border-gray-200">
     
    120120      )}
    121121
    122       {likedEntities.length === 0 && (!playlists || playlists.length === 0) && (
    123         <div className="flex flex-col items-center justify-center py-16 text-gray-300">
    124           <p className="text-lg font-medium text-gray-400">Nothing here yet</p>
    125           <p className="text-sm text-gray-400 mt-1">
    126             Start exploring music to build your collection
    127           </p>
    128         </div>
    129       )}
     122      {likedEntities &&
     123        likedEntities.length === 0 &&
     124        (!playlists || playlists.length === 0) && (
     125          <div className="flex flex-col items-center justify-center py-16 text-gray-300">
     126            <p className="text-lg font-medium text-gray-400">
     127              Nothing here yet
     128            </p>
     129            <p className="text-sm text-gray-400 mt-1">
     130              Start exploring music to build your collection
     131            </p>
     132          </div>
     133        )}
    130134    </div>
    131135  );
Note: See TracChangeset for help on using the changeset viewer.