<commit_before>/**
 * simple-timer.jsx
 */
var React = require('react');
var SetIntervalMixin = require('./components/SetIntervalMixin.jsx');
var StartButton = require('./components/StartButton.jsx');
var StopButton = require('./components/StopButton.jsx');

var Timer = React.createClass({
  mixins: [SetIntervalMixin],
  getInitialState: function() {
    var epoch = (new Date()).getTime();
    return {
      epoch: epoch
    };
  },
  componentDidMount: function() {
    this.setInterval(this.tick, 1000);
  },
  tick: function() {
    var newEpoch = this.state.epoch + 1000;
    this.setState({epoch: newEpoch});
  },
  render: function() {
    var formatDate = function(d) {
      var year   = d.getFullYear();
      var month  = ('0' + d.getMonth()).slice(-2);
      var day    = ('0' + d.getDate()).slice(-2);
      var hour   = ('0' + d.getHours()).slice(-2);
      var minute = ('0' + d.getMinutes()).slice(-2);
      var second = ('0' + d.getSeconds()).slice(-2);

      return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
    };

    var d = new Date(this.state.epoch);
    var dateString = formatDate(d);

    return (
        <div className="timer">
          <h2>{dateString}</h2>
	</div>
    );
  }
});

var RecentBox = React.createClass({
  render: function() {
    return (
      <div>
        <h4>Recent</h4>
        <span>Start: {this.props.recent.start}</span>
        |
        <span>Stop: {this.props.recent.stop}</span>
      </div>
    );
  }
});

var HistoryBox = React.createClass({
  render: function() {
    var historiesRender = this.props.histories.map(function(history) {
      return (
        <div>
          <span>Start: {history.start}</span>
          |
          <span>Stop: {history.stop}</span>
        </div>
      );
    });

    return (
      <div className="historyBox">
        <h4>Histories</h4>
        {historiesRender}
      </div>
    );
  }
});

var TimerBox = React.createClass({
  getInitialProps: function() {
    var work = 25 * 60 * 1000;
    var rest =  5 * 60 * 1000;
    return {
      work: work,
      rest: rest
    }<commit_msg>Remove separated components.<commit_after>/**
 * simple-timer.jsx
 */
var React = require('react');
var StartButton = require('./components/StartButton.jsx');
var StopButton = require('./components/StopButton.jsx');
var RecentBox = require('./components/RecentBox.jsx');
var HistoryBox = require('./components/HistoryBox.jsx');
var Timer = require('./components/Timer.jsx');

var TimerBox = React.createClass({
  getInitialProps: function() {
    var work = 25 * 60 * 1000;
    var rest =  5 * 60 * 1000;
    return {
      work: work,
      rest: rest
    }
{'fraction_non_alphanumeric': 0.1761194029850746, 'fraction_numerical': 0.020149253731343283, 'mean_word_length': 2.5462962962962963, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5791305', 'n_tokens_mistral': 913, 'n_tokens_neox': 867, 'n_words': 183}