<commit_before>import React from 'react';
import { Link } from 'react-router';
import Translate from 'react-translate-component';
import Thumbnail from '../../components/thumbnail';

class Recents extends React.Component {
  constructor() {
    super();
    this.state = {
      recents: []
    };
    document.documentElement.classList.add('on-secondary-page');
  }

  componentDidMount() {
    const { user } = this.props;
    user.get('recents', { project_id: this.props.project.id, sort: '-created_at' })
    .then(recents => this.setState({ recents }));
  }

  componentWillUnmount() {
    document.documentElement.classList.add('on-secondary-page');
  }

  render() {
    const { project } = this.props;
    return (
      <div className="secondary-page has-project-context">
        <div className="hero collections-hero">
          <div className="hero-container">
            <Translate content="classifier.recents" component="h1" />
          </div>
        </div>
        <ul className="collections-card-list">
          {this.state.recents.map(recent => (
            <li key={recent.id} className="collection-card">
              <Link to={`/projects/${project.slug}/talk/subjects/${recent.links.subject}`}>
                <Thumbnail
                  alt={`Subject ${recent.links.subject}`}
                  src={recent.locations[0]['image/jpeg']}
                  height={250}
                />
              </Link>
            </li>
            )
          )}
        </ul>
      </div>
    );
  }
}

export default Recents;<commit_msg>Support all subject file types.<commit_after>import React from 'react';
import { Link } from 'react-router';
import Translate from 'react-translate-component';
import Thumbnail from '../../components/thumbnail';
import getSubjectLocation from '../../lib/get-subject-location';

class Recents extends React.Component {
  constructor() {
    super();
    this.state = {
      recents: []
    };
    document.documentElement.classList.add('on-secondary-page');
  }

  componentDidMount() {
    const { user } = this.props;
    user.get('recents', { project_id: this.props.project.id, sort: '-created_at' })
    .then(recents => this.setState({ recents }));
  }

  componentWillUnmount() {
    document.documentElement.classList.add('on-secondary-page');
  }

  render() {
    const { project } = this.props;
    return (
      <div className="secondary-page has-project-context">
        <div className="hero collections-hero">
          <div className="hero-container">
            <Translate content="classifier.recents" component="h1" />
          </div>
        </div>
        <ul className="collections-card-list">
          {this.state.recents.map((recent) => {
            const { type, format, src } = getSubjectLocation(recent);
            return (
              <li key={recent.id} className="collection-card">
                <Link to={`/projects/${project.slug}/talk/subjects/${recent.links.subject}`}>
                  <Thumbnail
                    alt={`Subject ${recent.links.subject}`}
                    src={src}
                    type={type}
                    format={format}
                    height={250}
                  />
                </Link>
              </li>
            );
          })}
        </ul>
      </div>
    );
  }
}

export default Recents;
{'fraction_non_alphanumeric': 0.15232974910394265, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 2.0640439158279964, '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': '943503', 'n_tokens_mistral': 959, 'n_tokens_neox': 940, 'n_words': 169}