<commit_before>import React from 'react';
import { connect } from 'react-redux';
import { push, replace } from 'react-router-redux';
import {
  Table,
  TableBody,
  TableHeader,
  TableHeaderColumn,
  TableRow,
  TableRowColumn,
} from 'material-ui/Table';
import RaisedButton from 'material-ui/RaisedButton';
import ReactPaginate from 'react-paginate';
import {
  fetchTracks,
  updateTrack,
} from '../actions';
import { Status } from '../reducers/tracks';
import parseIntOr from '../utils/parseIntOr';
import { DEFAULT_PER_PAGE } from '../api/pagination';

const NO_IMAGE = '/web/no_image.png';

class TrackList extends React.Component {
  static get propTypes() {
    return {
      tracks: React.PropTypes.object.isRequired,
      page: React.PropTypes.number,
      fetchTracks: React.PropTypes.func,
      handleClick: React.PropTypes.func,
      handlePageChange: React.PropTypes.func,
    };
  }
  componentDidUpdate() {
    if (this.props.tracks.status === Status.Dirty) {
      this.props.fetchTracks(this.props.tracks.page,
                             this.props.tracks.perPage);
    }
  }
  render() {
    const rows = this.props.tracks.items.map(track => (
      <TableRow key={track.id}>
        <TableRowColumn>
          <a href={track.url}>
            <img
              src={track.thumbnail_url || NO_IMAGE}
              role="presentation"<commit_msg>Show DEAD_IMAGE if track state is `dead`<commit_after>import React from 'react';
import { connect } from 'react-redux';
import { push, replace } from 'react-router-redux';
import {
  Table,
  TableBody,
  TableHeader,
  TableHeaderColumn,
  TableRow,
  TableRowColumn,
} from 'material-ui/Table';
import RaisedButton from 'material-ui/RaisedButton';
import ReactPaginate from 'react-paginate';
import {
  fetchTracks,
  updateTrack,
} from '../actions';
import { Status } from '../reducers/tracks';
import parseIntOr from '../utils/parseIntOr';
import { DEFAULT_PER_PAGE } from '../api/pagination';

const NO_IMAGE   = '/web/no_image.png';
const DEAD_IMAGE = '/web/dead_image.png';

class TrackList extends React.Component {
  static get propTypes() {
    return {
      tracks: React.PropTypes.object.isRequired,
      page: React.PropTypes.number,
      fetchTracks: React.PropTypes.func,
      handleClick: React.PropTypes.func,
      handlePageChange: React.PropTypes.func,
    };
  }
  static getThumbnailUrl(track) {
    if (track.state === 'alive') {
      return track.thumbnail_url || NO_IMAGE;
    }
    return DEAD_IMAGE;
  }
  componentDidUpdate() {
    if (this.props.tracks.status === Status.Dirty) {
      this.props.fetchTracks(this.props.tracks.page,
                             this.props.tracks.perPage);
    }
  }
  render() {
    const rows = this.props.tracks.items.map(track => (
      <TableRow key={track.id}>
        <TableRowColumn>
          <a href={track.url}>
            <img
              src={TrackList.getThumbnailUrl(track)}
              role="presentation"
{'fraction_non_alphanumeric': 0.1286195286195286, 'fraction_numerical': 0.0, 'mean_word_length': 2.961333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6937166', 'n_tokens_mistral': 932, 'n_tokens_neox': 919, 'n_words': 191}