+ {items.map((virtualRow) => (
+
+
+
+
+
+
+ {rows?.[virtualRow.index]?.name}
+
+ {rows?.[virtualRow.index]?.releaseYear}
+ handlePlay?.(Play.NOW, rows?.[virtualRow.index]?.songs)}
+ />
+
+
+
+ data.data.id}
+ rowData={rows?.[virtualRow.index]?.songs}
+ rowHeight={60}
+ rowModelType="clientSide"
+ rowSelection="multiple"
+ />
+
+
+
+ ))}
+
+ );
+};
+
+export const AlbumArtistDiscographyDetailList = () => {
+ const { albumArtistId } = useParams() as { albumArtistId: string };
+ // const albumArtistQuery = useAlbumArtistDetail({ id: albumArtistId });
+
+ const albumsQuery = useAlbumList({
+ jfParams: { artistIds: albumArtistId },
+ ndParams: { artist_id: albumArtistId },
+ sortBy: AlbumListSort.YEAR,
+ sortOrder: SortOrder.DESC,
+ startIndex: 0,
+ });
+
+ const songsQuery = useSongList(
+ {
+ albumIds: albumsQuery.data?.items?.map((album) => album.id),
+ sortBy: SongListSort.ALBUM,
+ sortOrder: SortOrder.ASC,
+ startIndex: 0,
+ },
+ {
+ enabled: !albumsQuery.isLoading,
+ },
+ );
+
+ const songsByAlbum = useMemo(() => {
+ if (songsQuery.isLoading || albumsQuery.isLoading) return null;
+
+ const songsByAlbumMap = songsQuery?.data?.items?.reduce((acc, song) => {
+ if (!acc[song.albumId as keyof typeof acc]) {
+ acc[song.albumId as keyof typeof acc] = [];
+ }
+
+ acc[song.albumId as keyof typeof acc].push(song);
+
+ return acc;
+ }, {} as Record