You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
488 B
30 lines
488 B
7 years ago
|
import PropTypes from 'prop-types';
|
||
|
|
||
|
function SeasonNumber(props) {
|
||
|
const {
|
||
|
seasonNumber,
|
||
|
separator
|
||
|
} = props;
|
||
|
|
||
|
if (seasonNumber === 0) {
|
||
|
return `${separator}Specials`;
|
||
|
}
|
||
|
|
||
|
if (seasonNumber > 0) {
|
||
|
return `${separator}Season ${seasonNumber}`;
|
||
|
}
|
||
|
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
SeasonNumber.propTypes = {
|
||
|
seasonNumber: PropTypes.number.isRequired,
|
||
|
separator: PropTypes.string.isRequired
|
||
|
};
|
||
|
|
||
|
SeasonNumber.defaultProps = {
|
||
|
separator: '- '
|
||
|
};
|
||
|
|
||
|
export default SeasonNumber;
|