import React, { useState } from "react"; import PropTypes from "prop-types"; import { Map } from "immutable"; import { Episode } from "./episode"; export const Season = props => { const [show, setShow] = useState(false); return (
setShow(!show)}>
Season {props.season} {" "} — ({props.data.toList().size} episodes)
{props.data.toList().map(function(episode) { let key = `${episode.get("season")}-${episode.get("episode")}`; return ( ); })}
); }; Season.propTypes = { data: PropTypes.instanceOf(Map), season: PropTypes.number, showName: PropTypes.string, addToWishlist: PropTypes.func, addTorrent: PropTypes.func, refreshSubtitles: PropTypes.func, getEpisodeDetails: PropTypes.func };