<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { formatTime, formatDate } from '../helpers';

const TimelogItem = props => (
  <tr key={`item-${props.id}`} className="timelogs__item">
    <td>{props.project}</td>
    <td>{props.name}</td>
    <td>{formatTime(props.seconds)}</td>
    <td>{props.started && formatDate(props.started) || ''}</td>
    <td className="timelogs__deletecell">
      <button
        onClick={() => props.handleDelete(props.id)}
        className="timelogs__item-delete button--danger"
      >
        X
      </button>
    </td>
  </tr>
);

TimelogItem.defaultProps = {
  started: '',
  name: '',
  seconds: 0,
  showDate: false
};

TimelogItem.propTypes = {
  started: PropTypes.string,
  name: PropTypes.string,
  // project: PropTypes.string,
  seconds: PropTypes.number,
  // showDate: PropTypes.bool,
  id: PropTypes.string.isRequired
};

export default TimelogItem;<commit_msg>refactoring<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { formatTime } from '../helpers';

const TimelogItem = props => {
  const date = moment(new Date(props.started)).format('YYYY-MM-DD HH:mm');
  return (
    <tr key={`item-${props.id}`} className="timelogs__item">
      <td>{props.project}</td>
      <td>{props.name}</td>
      <td>{formatTime(props.seconds)}</td>
      <td title={date}>{(props.started && date.substr(0, 10)) || ''}</td>
      <td className="timelogs__deletecell">
        <button
          onClick={() => props.handleDelete(props.id)}
          className="timelogs__item-delete button--danger"
        >
          X
        </button>
      </td>
    </tr>
  );
};

TimelogItem.defaultProps = {
  started: '',
  name: '',
  seconds: 0,
  showDate: false
};

TimelogItem.propTypes = {
  started: PropTypes.string,
  name: PropTypes.string,
  // project: PropTypes.string,
  seconds: PropTypes.number,
  // showDate: PropTypes.bool,
  id: PropTypes.string.isRequired
};

export default TimelogItem;
{'fraction_non_alphanumeric': 0.17010816125860373, 'fraction_numerical': 0.0024582104228121925, 'mean_word_length': 3.3390191897654584, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 35, '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': '5428896', 'n_tokens_mistral': 670, 'n_tokens_neox': 681, 'n_words': 128}