import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; import formatBytes from 'Utilities/Number/formatBytes'; import { ColorImpairedConsumer } from 'App/ColorImpairedContext'; import DescriptionList from 'Components/DescriptionList/DescriptionList'; import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem'; import styles from './ArtistIndexFooter.css'; function ArtistIndexFooter({ artist }) { const count = artist.length; let tracks = 0; let trackFiles = 0; let ended = 0; let continuing = 0; let monitored = 0; let totalFileSize = 0; artist.forEach((s) => { const { statistics = {} } = s; const { trackCount = 0, trackFileCount = 0, sizeOnDisk = 0 } = statistics; tracks += trackCount; trackFiles += trackFileCount; if (s.status === 'ended') { ended++; } else { continuing++; } if (s.monitored) { monitored++; } totalFileSize += sizeOnDisk; }); return ( {(enableColorImpairedMode) => { return (
Continuing (All tracks downloaded)
Ended (All tracks downloaded)
Missing Tracks (Artist monitored)
Missing Tracks (Artist not monitored)
); }} ); } ArtistIndexFooter.propTypes = { artist: PropTypes.arrayOf(PropTypes.object).isRequired }; export default ArtistIndexFooter;