<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';

class Day extends Component {
  render() {
    let classes = ['Day'];
    if (this.props.today.isSame(this.props.date, 'day')) {
      classes.push('today');
    }
    if (
      this.props.selected &&
      this.props.selected.isSame(this.props.date, 'day')
    ) {
      classes.push('selected');
    }
    classes = classes.concat(this.props.classes);

    let body;
    if (!!this.props.children) {
      body = this.props.children;
    } else {
      body = (
        <button
          className="Day-inner"
          onClick={() => this.props.handleClick(this.props.date)}
          type="button"
        >
          {this.props.date.format('D')}
        </button>
      );
    }

    return (
      <td
        className={classes.join(' ')}
        data-date={this.props.date.toISOString()}
        data-day={this.props.date.format('D')}
      >
        {body}
      </td>
    );
  }
}

Day.propTypes = {
  handleClick: PropTypes.func.isRequired,
  date: PropTypes.object.isRequired,
  //month: React.PropTypes.object.isRequired,
  today: PropTypes.object.isRequired,
  selected: PropTypes.object,
  children: PropTypes.node,
};

export default Day;<commit_msg>Destructure props<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';

class Day extends Component {

  render() {
    const {
      today,
      date,
      selected,
      classes,
      handleClick,
      children,
    } = this.props;

    const classNames = ['Day'];
    if (today.isSame(date, 'day')) {
      classNames.push('today');
    }
    if (selected && selected.isSame(date, 'day')) {
      classNames.push('selected');
    }

    let body;
    if (!!children) {
      body = children;
    } else {
      body = (
        <button
          className="Day-inner"
          onClick={() => handleClick(date)}
          type="button"
        >
          {date.format('D')}
        </button>
      );
    }

    return (
      <td
        className={[...classNames, ...classes].join(' ')}
        data-date={date.toISOString()}
        data-day={date.format('D')}
      >
        {body}
      </td>
    );
  }
}

Day.propTypes = {
  handleClick: PropTypes.func.isRequired,
  date: PropTypes.object.isRequired,
  today: PropTypes.object.isRequired,
  selected: PropTypes.object,
  children: PropTypes.node,
};

export default Day;
{'fraction_non_alphanumeric': 0.15504511894995898, 'fraction_numerical': 0.0, 'mean_word_length': 2.17578125, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6454029', 'n_tokens_mistral': 768, 'n_tokens_neox': 773, 'n_words': 137}