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.
46 lines
1.3 KiB
46 lines
1.3 KiB
7 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
|
||
|
import { sizes } from 'Helpers/Props';
|
||
|
import ProgressBar from 'Components/ProgressBar';
|
||
7 years ago
|
import styles from './ArtistIndexProgressBar.css';
|
||
7 years ago
|
|
||
7 years ago
|
function ArtistIndexProgressBar(props) {
|
||
7 years ago
|
const {
|
||
|
monitored,
|
||
|
status,
|
||
|
trackCount,
|
||
|
trackFileCount,
|
||
|
posterWidth,
|
||
|
detailedProgressBar
|
||
|
} = props;
|
||
|
|
||
|
const progress = trackCount ? trackFileCount / trackCount * 100 : 100;
|
||
|
const text = `${trackFileCount} / ${trackCount}`;
|
||
|
|
||
|
return (
|
||
|
<ProgressBar
|
||
|
className={styles.progressBar}
|
||
|
containerClassName={styles.progress}
|
||
|
progress={progress}
|
||
|
kind={getProgressBarKind(status, monitored, progress)}
|
||
|
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
|
||
|
showText={detailedProgressBar}
|
||
|
text={text}
|
||
|
title={detailedProgressBar ? null : text}
|
||
|
width={posterWidth}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
7 years ago
|
ArtistIndexProgressBar.propTypes = {
|
||
7 years ago
|
monitored: PropTypes.bool.isRequired,
|
||
|
status: PropTypes.string.isRequired,
|
||
|
trackCount: PropTypes.number.isRequired,
|
||
|
trackFileCount: PropTypes.number.isRequired,
|
||
|
posterWidth: PropTypes.number.isRequired,
|
||
|
detailedProgressBar: PropTypes.bool.isRequired
|
||
|
};
|
||
|
|
||
7 years ago
|
export default ArtistIndexProgressBar;
|