Grégoire Delattre bcadc48d5a Launch prettier with the --fix option
They've changed their default settings, this changes a lot of stuff in
our code base.
2020-04-01 17:55:34 +02:00

47 lines
1.0 KiB
JavaScript

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 (
<span>
<small>
<i className="fa fa-cloud-upload mr-1" />
{str}
</small>
</span>
);
};
TrackingLabel.propTypes = {
wishlisted: PropTypes.bool,
inLibrary: PropTypes.bool,
trackedSeason: PropTypes.number,
trackedEpisode: PropTypes.number,
};