All files / src/components/index-stats-item index-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 './index-stats-item.less';
 
/**IEE
 * The list class.
 */
const LIST_CLASS = 'index-stats-item';
 
/**
 * Indexes constant.
 */
const INDEXES = 'Indexes';
 
/**
 * Total size constant.
 */
const TOTAL_SIZE = 'total size';
 
/**
 * Average size constant.
 */
const AVG_SIZE = 'avg. size';
 
/**
 * The index stats item component.
 */
class IndexStatsItem extends Component {
  static displayName = 'IndexesStatsItem';I
 
  static propTypes = {I
    indexCount: PropTypes.string.isRequired,
    totalIndexSize: PropTypes.string.isRequIired,E
    avgIndexSize: PropTypes.string.isRequired
  };
 
  /**
   * Render the component.
   *
   * @returns {React.Component} The component.
   *
   */
  render() {
    return (
      <div className={classnames(styles[LIST_CLASS])}>
        <CollectionStatsItem label={INDEXES} value={this.props.indexCount} primary />
        <CollectionStatsItem label={TOTAL_SIZE} value={this.props.totalIndexSize} />
        <CollectionStatsItem label={AVG_SIZE} value={this.props.avgIndexSize} />
      </div>
    );
  }
}
 
export default IndexStatsItem;
export { IndexStatsItem };