<commit_before>const React = require('react')
const moment = require('moment')

module.exports = React.createClass({
  displayName: 'InterestingProject',

  propTypes: {
    prognosis: React.PropTypes.string.isRequired,
    name: React.PropTypes.string.isRequired,
    lastBuildTime: React.PropTypes.string.isRequired,
    showBrokenBuildTimers: React.PropTypes.bool.isRequired
  },

  _isSick() {
    return this.props.prognosis === 'sick'
  },

  _toRelativeTime(time) {
    return moment(time).fromNow(true)
  },

  _brokenBuildTimer() {
    if (this.props.showBrokenBuildTimers && this._isSick()) {
      return <span className='monitor-time-broken'> {this._toRelativeTime(this.props.lastBuildTime)}</span>
    }
  },

  render() {
    return (
      <li className={'monitor-project monitor-' + this.props.prognosis}>
        <div className='monitor-outer-container'>
          <div className='monitor-inner-container'>
            <span className='monitor-project-name'>{this.props.name}</span>
            {this._brokenBuildTimer()}
          </div>
        </div>
      </li>
    )
  }
})<commit_msg>Chris - handle null last build time<commit_after>const React = require('react')
const moment = require('moment')
const _ = require('lodash')

module.exports = React.createClass({
  displayName: 'InterestingProject',

  propTypes: {
    prognosis: React.PropTypes.string.isRequired,
    name: React.PropTypes.string.isRequired,
    lastBuildTime: React.PropTypes.string.isRequired,
    showBrokenBuildTimers: React.PropTypes.bool.isRequired
  },

  _isSick() {
    return this.props.prognosis === 'sick'
  },

  _toRelativeTime(time) {
    return _.isEmpty(_.trim(time)) ? '??' : moment(time).fromNow(true)
  },

  _brokenBuildTimer() {
    if (this.props.showBrokenBuildTimers && this._isSick()) {
      return <span className='monitor-time-broken'> {this._toRelativeTime(this.props.lastBuildTime)}</span>
    }
  },

  render() {
    return (
      <li className={'monitor-project monitor-' + this.props.prognosis}>
        <div className='monitor-outer-container'>
          <div className='monitor-inner-container'>
            <span className='monitor-project-name'>{this.props.name}</span>
            {this._brokenBuildTimer()}
          </div>
        </div>
      </li>
    )
  }
})
{'fraction_non_alphanumeric': 0.14888985633434915, 'fraction_numerical': 0.0, 'mean_word_length': 3.287313432835821, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '662857', 'n_tokens_mistral': 733, 'n_tokens_neox': 714, 'n_words': 108}