<commit_before>'use strict';

import React from 'react';
import classNames from 'classnames';
import DateUtils from './utils/DateUtils.js';

const Picker = React.createClass({

  propTypes: {
    date:         React.PropTypes.any.isRequired,
    minDate:      DateUtils.evaluateDateProp,
    maxDate:      DateUtils.evaluateDateProp,
    isSelected:   React.PropTypes.bool.isRequired,
    isCurrent:    React.PropTypes.bool.isRequired,
    isEnabled:    React.PropTypes.bool.isRequired,
    isDisabled:   React.PropTypes.bool,
    onSelectDate: React.PropTypes.func.isRequired,
    mode:         React.PropTypes.string.isRequired
  },

  handleClick(e) {
    e.preventDefault();
    if (this.props.isEnabled) {
      this.props.onSelectDate(this.props.date);
    }
  },

  render() {
    let formatMode;

    switch (this.props.mode) {
      case 'day':
        formatMode = 'D';
        break;

      case 'month':
        formatMode = 'MMM';
        break;

      case 'year':
        formatMode = 'YYYY';
        break;
    }
    const string = this.props.date.format(formatMode);
    const value = string.charAt(0).toUpperCase() + string.slice(1); // first letter always uppercase

    const classes = classNames({
        this.props.mode: true,
        current: this.props.isCurrent,
        selected: this.props.isSelected,
        disabled: !this.props.isEnabled
      });

    return (
      <div className={'picker button ' + classes} onClick={this.handleClick}>
        <span>{value}</span>
      </div>
    );
  }
});

export default Picker;<commit_msg>Fix computed key in classNames object<commit_after>'use strict';

import React from 'react';
import classNames from 'classnames';
import DateUtils from './utils/DateUtils.js';

const Picker = React.createClass({

  propTypes: {
    date:         React.PropTypes.any.isRequired,
    minDate:      DateUtils.evaluateDateProp,
    maxDate:      DateUtils.evaluateDateProp,
    isSelected:   React.PropTypes.bool.isRequired,
    isCurrent:    React.PropTypes.bool.isRequired,
    isEnabled:    React.PropTypes.bool.isRequired,
    isDisabled:   React.PropTypes.bool,
    onSelectDate: React.PropTypes.func.isRequired,
    mode:         React.PropTypes.string.isRequired
  },

  handleClick(e) {
    e.preventDefault();
    if (this.props.isEnabled) {
      this.props.onSelectDate(this.props.date);
    }
  },

  render() {
    let formatMode;

    switch (this.props.mode) {
      case 'day':
        formatMode = 'D';
        break;

      case 'month':
        formatMode = 'MMM';
        break;

      case 'year':
        formatMode = 'YYYY';
        break;
    }
    const string = this.props.date.format(formatMode);
    const value = string.charAt(0).toUpperCase() + string.slice(1); // first letter always uppercase

    const classes = classNames({
        [this.props.mode]: true,
        current: this.props.isCurrent,
        selected: this.props.isSelected,
        disabled: !this.props.isEnabled
      });

    return (
      <div className={'picker button ' + classes} onClick={this.handleClick}>
        <span>{value}</span>
      </div>
    );
  }
});

export default Picker;
{'fraction_non_alphanumeric': 0.12428662016487001, 'fraction_numerical': 0.0012682308180088776, 'mean_word_length': 2.544943820224719, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4389448', 'n_tokens_mistral': 974, 'n_tokens_neox': 968, 'n_words': 192}