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

const dateOptions = {
  year: 'numeric',
  month: 'short',
  day: 'numeric',
};

const timeOptions = {
  hour: '2-digit',
  minute: '2-digit',
};

export default class CourseList extends Component {
  static propTypes = {
    courses: PropTypes.arrayOf(PropTypes.shape()),
  };

  static defaultProps = {
    courses: [],
  };

  constructor(props) {
    super(props);
    this.courseRenderer = this.courseRenderer.bind(this);
  }

  courseRenderer(course) {
    return (
      <div className="posts-teaser slice" key={course.uuid}>
        <div className="container">
          <h2 className="posts-title">
            <a className="no-link-style" href={`/course/${course.permalink}`}>
              {course.title}
            </a>
          </h2>

          <time className="posts-date meta">
            <span className="meta-content">
              {(new Date(course.date)).toLocaleString('fr-FR', dateOptions)}
              {' à '}
              {(new Date(course.date)).toLocaleTimeString('fr-FR', timeOptions)}
              {' par '}
              <a
                className="author-link"
                href={`http://blog.eleven-labs.com/authors/${course.author.username}`}
              >
                {course.author.name}
              </a>
            </span>
          </time><commit_msg>a little optimization<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';

const dateOptions = {
  year: 'numeric',
  month: 'short',
  day: 'numeric',
};

const timeOptions = {
  hour: '2-digit',
  minute: '2-digit',
};

export default class CourseList extends Component {
  static propTypes = {
    courses: PropTypes.arrayOf(PropTypes.shape()),
  };

  static defaultProps = {
    courses: [],
  };

  constructor(props) {
    super(props);
    this.courseRenderer = this.courseRenderer.bind(this);
  }

  courseRenderer(course) {
    const date = new Date(course.date);

    return (
      <div className="posts-teaser slice" key={course.uuid}>
        <div className="container">
          <h2 className="posts-title">
            <a className="no-link-style" href={`/course/${course.permalink}`}>
              {course.title}
            </a>
          </h2>

          <time className="posts-date meta">
            <span className="meta-content">
              {date.toLocaleString('fr-FR', dateOptions)}
              {' à '}
              {date.toLocaleTimeString('fr-FR', timeOptions)}
              {' par '}
              <a
                className="author-link"
                href={`http://blog.eleven-labs.com/authors/${course.author.username}`}
              >
                {course.author.name}
              </a>
            </span>
          </time>
{'fraction_non_alphanumeric': 0.15097690941385436, 'fraction_numerical': 0.002841918294849023, 'mean_word_length': 2.054229934924078, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '203263', 'n_tokens_mistral': 823, 'n_tokens_neox': 815, 'n_words': 155}