<commit_before>'use strict';

var React = require('react');
var ReactPropTypes = React.PropTypes;
var log = require('../utils/logger')('Footer', '#6c71c4');

var TodoCollection = require('../utils/TodoCollection');

var Footer = React.createClass({

  propTypes: {
    allTodos: ReactPropTypes.object.isRequired
  },

  /**
   * @return {object}
   */
  render: function() {
    log('render');
    var allTodos = this.props.allTodos;
    var total = allTodos.size;

    if (total === 0) {
      return null;
    }

    var completed = allTodos
      .filter(function (todo) {
        return todo.complete;
      })
      .size;

    var itemsLeft = total - completed;
    var itemsLeftPhrase = itemsLeft === 1 ? ' item ' : ' items ';
    itemsLeftPhrase += 'left';

    // Undefined and thus not rendered if no completed items are left.
    var clearCompletedButton;
    if (completed) {
      clearCompletedButton =
        <button
          id="clear-completed"<commit_msg>Added line to denote renders.<commit_after>'use strict';

var React = require('react');
var ReactPropTypes = React.PropTypes;
var log = require('../utils/logger')('Footer', '#6c71c4');

var TodoCollection = require('../utils/TodoCollection');

var Footer = React.createClass({

  propTypes: {
    allTodos: ReactPropTypes.object.isRequired
  },

  /**
   * @return {object}
   */
  render: function() {
    log('render');
    log('-----------------------------------------------------');
    var allTodos = this.props.allTodos;
    var total = allTodos.size;

    if (total === 0) {
      return null;
    }

    var completed = allTodos
      .filter(function (todo) {
        return todo.complete;
      })
      .size;

    var itemsLeft = total - completed;
    var itemsLeftPhrase = itemsLeft === 1 ? ' item ' : ' items ';
    itemsLeftPhrase += 'left';

    // Undefined and thus not rendered if no completed items are left.
    var clearCompletedButton;
    if (completed) {
      clearCompletedButton =
        <button
          id="clear-completed"
{'fraction_non_alphanumeric': 0.1579724409448819, 'fraction_numerical': 0.005905511811023622, 'mean_word_length': 2.4457627118644067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1983778', 'n_tokens_mistral': 640, 'n_tokens_neox': 612, 'n_words': 154}