import React from "react"; import PropTypes from "prop-types"; export const TrackingLabel = ({ wishlisted, inLibrary, trackedSeason, trackedEpisode, }) => { if (wishlisted === false) { return null; } if (wishlisted === true && inLibrary === true) { return null; } if (trackedEpisode === null && trackedSeason === null) { return null; } let str = ""; if (trackedSeason === 0 && trackedEpisode === 0) { str = "All the episodes will be downloaded automatically"; } else if (trackedSeason > 0 && trackedEpisode > 0) { str = `All the episodes will be downloaded automatically starting from season ${trackedSeason} episode ${trackedEpisode}`; } else { str = "This movie will be downloaded automatically"; } return ( {str} ); }; TrackingLabel.propTypes = { wishlisted: PropTypes.bool, inLibrary: PropTypes.bool, trackedSeason: PropTypes.number, trackedEpisode: PropTypes.number, };