mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-14 09:45:06 +01:00
14 lines
709 B
JavaScript
14 lines
709 B
JavaScript
|
import React from 'react';
|
||
|
import { TypeSelector } from './TypeSelector';
|
||
|
import { NumberSelector } from './NumberSelector';
|
||
|
import './EpisodeSelector.css'
|
||
|
|
||
|
export function EpisodeSelector({ setSeason, setEpisode, seasons, episodes, currentSeason, currentEpisode }) {
|
||
|
return (
|
||
|
<div>
|
||
|
<TypeSelector setType={setSeason} choices={seasons.map(v=>({ value: v.toString(), label: `Season ${v}`}))} selected={currentSeason}/><br></br>
|
||
|
<NumberSelector setType={(e) => setEpisode({episode: e, season: currentSeason})} choices={episodes.map(v=>({ value: v.toString(), label: v}))} selected={currentEpisode.season === currentSeason?currentEpisode.episode:null}/>
|
||
|
</div>
|
||
|
)
|
||
|
}
|