PromoCursed/src/components/FullPlaylistBlock.tsx

33 lines
838 B
TypeScript
Raw Normal View History

2024-08-28 00:07:24 +04:00
import { IGenre, IPlaylist } from "../models/IModels";
import { getPlaylistsByGenre } from "../scripts/scripts";
import { PlaylistsBlock } from "./PlaylistsBlock";
export function FullPlaylistBlock({playlists}: {playlists: IPlaylist[]}, {genres}: {genres: IGenre[]}) {
let genres_list: string[] = [];
let list_of_playlist_list = [];
{for (let genre of genres) {
genres_list.push(genre.name);
}
for (let genre of genres) {
list_of_playlist_list.push(getPlaylistsByGenre(genre.name, playlists));
}
const result = [];
for (let list of list_of_playlist_list) {
result.push(
<PlaylistsBlock playlists={list}/>
)
}
return (
<div className="container">
<h5>Плейлисты</h5>
{result}
</div>
)
}
}