PromoCursed/src/components/FullPlaylistBlock.tsx
2024-08-28 00:07:24 +04:00

33 lines
838 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
)
}
}