All files / src/components/document-stats-item document-stats-item.jsx

83.58% Statements 56/67
59.46% Branches 22/37
100% Functions 12/12
85.11% Lines 40/47
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59    1x     1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   5x   7x   7x   1x         1x         1x         1x         1x      
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import CollectionStatsItem from 'components/collection-stats-item';
 
import styles from './document-stats-item.less';
 
/**IEE
 * The list class.
 */
const LIST_CLASS = 'document-stats-item';
 
/**
 * Documents constant.
 */
const DOCUMENTS = 'Documents';
 
/**
 * Total size constant.
 */
const TOTAL_SIZE = 'total size';
 
/**
 * Average size constant.
 */
const AVG_SIZE = 'avg. size';
 
/**
 * The document stats item component.
 */
class DocumentStatsItem extends Component {
  static displayName = 'DocumentStatsItem';I
 
  static propTypes = {I
    documentCount: PropTypes.string.isRequired,
    totalDocumentSize: PropTypes.string.isRIequired,E
    avgDocumentSize: PropTypes.string.isRequired
  };
 
  /**
   * Render the component.
   *
   * @returns {React.Component} The component.
   *
   */
  render() {
    return (
      <div className={classnames(styles[LIST_CLASS])}>
        <CollectionStatsItem label={DOCUMENTS} value={this.props.documentCount} primary />
        <CollectionStatsItem label={TOTAL_SIZE} value={this.props.totalDocumentSize} />
        <CollectionStatsItem label={AVG_SIZE} value={this.props.avgDocumentSize} />
      </div>
    );
  }
}
 
export default DocumentStatsItem;
export { DocumentStatsItem };