<commit_before>/* global API_HOST */
import React from 'react';
import { threshold, formatSeconds } from 'utility';
import Table from 'components/Table';
import strings from 'lang';
import Heading from 'components/Heading';

import { heroTd, heroTdColumn } from '../matchColumns';
import styles from './Vision.css';

const durationObserverColor = threshold(0, [121, 241, 371], [styles.red, styles.yelor, styles.green]);
const durationSentryColor = threshold(0, [81, 161, 251], [styles.red, styles.yelor, styles.green]);

const columns = [
  {
    displayName: strings.ward_log_type,
    field: 'type',
  },
  {
    ...heroTdColumn,
    displayName: strings.ward_log_owner,
    sortFn: false,
  },
  {
    center: true,
    displayName: strings.ward_log_entered_at,
    field: 'enter_time',
  },
  {
    center: true,
    displayName: strings.ward_log_left_at,
    field: 'left_time',
  },
  {
    center: true,
    displayName: strings.ward_log_duration,
    field: 'duration',
  },
  {
    displayName: strings.ward_log_killed_by,
    field: 'killer',
  },
];

const generateData = match => (log) => {
  const wardKiller = (log.left && log.left.player1) ? heroTd(match.players[log.left.player1]) : '';
  const duration = log.left ? log.left.time - log.entered.time : '';

  const durationColor = log.type === 'observer' ? durationObserverColor(duration) : durationSentryColor(duration);

  return {
    ...match.players[log.player],
    type: <img height="29" src={`${API_HOST}/apps/dota2/images/items/ward_${log.type}_lg.png`} role="presentation" />,
    enter_time: formatSeconds(log.entered.time),
    left_time: formatSeconds(log.left && log.left.time) || '-',
    duration: <span style={{ color: durationColor }}>{formatSeconds(duration)}</span>,
    killer: wardKiller,
  };
};

const VisionLog = ({ match, wards }) => (
  <div className={styles.visionLog}>
    <Heading title={strings.vision_ward_log} />
    <Table data={wards.map(generateData(match))} columns={columns} />
  </div>
);

export default VisionLog;<commit_msg>remove unused class<commit_after>/* global API_HOST */
import React from 'react';
import { threshold, formatSeconds } from 'utility';
import Table from 'components/Table';
import strings from 'lang';
import Heading from 'components/Heading';

import { heroTd, heroTdColumn } from '../matchColumns';
import styles from './Vision.css';

const durationObserverColor = threshold(0, [121, 241, 371], [styles.red, styles.yelor, styles.green]);
const durationSentryColor = threshold(0, [81, 161, 251], [styles.red, styles.yelor, styles.green]);

const columns = [
  {
    displayName: strings.ward_log_type,
    field: 'type',
  },
  {
    ...heroTdColumn,
    displayName: strings.ward_log_owner,
    sortFn: false,
  },
  {
    center: true,
    displayName: strings.ward_log_entered_at,
    field: 'enter_time',
  },
  {
    center: true,
    displayName: strings.ward_log_left_at,
    field: 'left_time',
  },
  {
    center: true,
    displayName: strings.ward_log_duration,
    field: 'duration',
  },
  {
    displayName: strings.ward_log_killed_by,
    field: 'killer',
  },
];

const generateData = match => (log) => {
  const wardKiller = (log.left && log.left.player1) ? heroTd(match.players[log.left.player1]) : '';
  const duration = log.left ? log.left.time - log.entered.time : '';

  const durationColor = log.type === 'observer' ? durationObserverColor(duration) : durationSentryColor(duration);

  return {
    ...match.players[log.player],
    type: <img height="29" src={`${API_HOST}/apps/dota2/images/items/ward_${log.type}_lg.png`} role="presentation" />,
    enter_time: formatSeconds(log.entered.time),
    left_time: formatSeconds(log.left && log.left.time) || '-',
    duration: <span style={{ color: durationColor }}>{formatSeconds(duration)}</span>,
    killer: wardKiller,
  };
};

const VisionLog = ({ match, wards }) => (
  <div>
    <Heading title={strings.vision_ward_log} />
    <Table data={wards.map(generateData(match))} columns={columns} />
  </div>
);

export default VisionLog;
{'fraction_non_alphanumeric': 0.15978233984664852, 'fraction_numerical': 0.011872372000989364, 'mean_word_length': 4.061326658322904, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '7308474', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1329, 'n_words': 278}