<commit_before>/* eslint-disable react/no-danger */
import React from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { flow } from 'lodash/fp';
import * as libs from '../../libs';
import * as deps from '../../deps';

const Title = ({ post, categories, users, color, displayCategories, t }) => (
  <div className="content is-medium">
    <h1><div dangerouslySetInnerHTML={{ __html: post.title.rendered }} /></h1>
    <h6>
      {users[post.author] &&
        <span>
          {t('By')}{' '}<span style={{ fontWeight: 600 }}>{users[post.author].name}</span>
        </span>}
      {displayCategories && post.categories.map(category => (
          <span key={category}>
            <Link
              style={{ color: libs.darkenColor(color) }}
              to={`?cat=${categories[category].id}`}
            >
              #{categories[category].name}
            </Link>
            {' '}
          </span>
        ))}
    </h6>
  </div>
);

Title.propTypes = {
  post: React.PropTypes.shape({}),
  categories: React.PropTypes.shape({}),
  users: React.PropTypes.shape({}),
  color: React.PropTypes.string,<commit_msg>Add space to categories and prevent undefined error.<commit_after>/* eslint-disable react/no-danger */
import React from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { flow } from 'lodash/fp';
import * as libs from '../../libs';
import * as deps from '../../deps';

const Title = ({ post, categories, users, color, displayCategories, t }) => (
  <div className="content is-medium">
    <h1><div dangerouslySetInnerHTML={{ __html: post.title.rendered }} /></h1>
    <h6>
      {users[post.author] &&
        <span>
          {t('By')}{' '}<span style={{ fontWeight: 600 }}>{users[post.author].name}</span>
        </span>}
      {' '}
      {displayCategories && post.categories && post.categories.map(category => (
          <span key={category}>
            <Link
              style={{ color: libs.darkenColor(color) }}
              to={`?cat=${categories[category].id}`}
            >
              #{categories[category].name}
            </Link>
            {' '}
          </span>
        ))}
    </h6>
  </div>
);

Title.propTypes = {
  post: React.PropTypes.shape({}),
  categories: React.PropTypes.shape({}),
  users: React.PropTypes.shape({}),
  color: React.PropTypes.string,
{'fraction_non_alphanumeric': 0.18760064412238325, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 2.53988603988604, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, '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': '1988100', 'n_tokens_mistral': 777, 'n_tokens_neox': 764, 'n_words': 171}