1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -04:00

Refactor Series index to use react-window

This commit is contained in:
Mark McDowall
2023-01-05 18:20:49 -08:00
committed by Mark McDowall
parent de56862bb9
commit d022679b7d
92 changed files with 3527 additions and 4462 deletions
@@ -1,11 +1,20 @@
import PropTypes from 'prop-types';
import React from 'react';
import ProgressBar from 'Components/ProgressBar';
import { sizes } from 'Helpers/Props';
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
import styles from './SeriesIndexProgressBar.css';
function SeriesIndexProgressBar(props) {
interface SeriesIndexProgressBarProps {
monitored: boolean;
status: string;
episodeCount: number;
episodeFileCount: number;
totalEpisodeCount: number;
posterWidth: number;
detailedProgressBar: boolean;
}
function SeriesIndexProgressBar(props: SeriesIndexProgressBarProps) {
const {
monitored,
status,
@@ -13,10 +22,10 @@ function SeriesIndexProgressBar(props) {
episodeFileCount,
totalEpisodeCount,
posterWidth,
detailedProgressBar
detailedProgressBar,
} = props;
const progress = episodeCount ? episodeFileCount / episodeCount * 100 : 100;
const progress = episodeCount ? (episodeFileCount / episodeCount) * 100 : 100;
const text = `${episodeFileCount} / ${episodeCount}`;
return (
@@ -34,14 +43,4 @@ function SeriesIndexProgressBar(props) {
);
}
SeriesIndexProgressBar.propTypes = {
monitored: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
episodeCount: PropTypes.number.isRequired,
episodeFileCount: PropTypes.number.isRequired,
totalEpisodeCount: PropTypes.number.isRequired,
posterWidth: PropTypes.number.isRequired,
detailedProgressBar: PropTypes.bool.isRequired
};
export default SeriesIndexProgressBar;