import classNames from 'classnames'; import PropTypes from 'prop-types'; import React, { PureComponent } from 'react'; import { ColorImpairedConsumer } from 'App/ColorImpairedContext'; import DescriptionList from 'Components/DescriptionList/DescriptionList'; import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem'; import formatBytes from 'Utilities/Number/formatBytes'; import translate from 'Utilities/String/translate'; import styles from './AuthorIndexFooter.css'; class AuthorIndexFooter extends PureComponent { // // Render render() { const { author } = this.props; const count = author.length; let books = 0; let bookFiles = 0; let ended = 0; let continuing = 0; let monitored = 0; let totalFileSize = 0; author.forEach((s) => { const { statistics = {} } = s; const { bookCount = 0, bookFileCount = 0, sizeOnDisk = 0 } = statistics; books += bookCount; bookFiles += bookFileCount; if (s.status === 'ended') { ended++; } else { continuing++; } if (s.monitored) { monitored++; } totalFileSize += sizeOnDisk; }); return ( {(enableColorImpairedMode) => { return (
{translate('ContinuingAllBooksDownloaded')}
{translate('EndedAllBooksDownloaded')}
{translate('MissingBooksAuthorMonitored')}
{translate('MissingBooksAuthorNotMonitored')}
); }} ); } } AuthorIndexFooter.propTypes = { author: PropTypes.arrayOf(PropTypes.object).isRequired }; export default AuthorIndexFooter;