<commit_before>import Icon from '../Icon';
import React from 'react';
import ReactTooltip from 'react-tooltip';
import moment from 'moment';
import radium from 'radium';
import styles from './styles';

function renderStatusColor(state) {
  return Object.assign({}, styles.storyDetail, {
    background: statusColors[state].bg,
    color: statusColors[state].text,
    margin: 'auto 0 auto auto',
  });
}

const StoryCard = props => (
  <div key={props.storyIndex} style={styles.storyCard} onClick={() => props.onClick(props.story)}>
    <ul style={styles.storyDetails}>
      <li
        data-tip="Click to copy to clipboard"
        className="storyId"
        style={Object.assign({}, styles.storyDetail, {
          fontFamily: 'Source Code pro',
        })}
        data-clipboard-text={props.story.id}
      >
        <Icon icon="content_copy" style={{ marginRight: 5 }} />
        {props.story.id}
      </li>
      <li style={styles.storyDetail}>
        <Icon icon={typeIcons[props.story.story_type]} style={{ marginRight: 5 }} />
        {props.story.story_type}
      </li>
      <li style={renderStatusColor(props.story.current_state)}>
        {statuses.indexOf(props.story.current_state)} - {props.story.current_state}
      </li>
    </ul>
    <p style={styles.storyName}>
      {props.story.name}
    </p>
    <div style={styles.labelsWrapper}>
      {props.story.labels.length ? props.story.labels.map((label, labelIndex) => (
        <span data-tip={props.labelFilters.includes(label.id) ? `Remove "${label.name}" from filter` : `Add "${label.name}" to filter`} key={`${props.storyIndex}-${labelIndex}`} style={styles.labelItem} onClick={() => props.handleLabelChange(label.id)}>{label.name}</span>
      )) : false}
    </div>
    <span style={styles.lastUpdated}>Last updated {moment(props.story.updated_at).fromNow()}</span>
    <ReactTooltip effect="solid" place="top" />
  </div>
);

StoryCard.propTypes = {
  story: React.PropTypes.object,<commit_msg>added back outlink to PT story for prod usage<commit_after>import Icon from '../Icon';
import React from 'react';
import ReactTooltip from 'react-tooltip';
import moment from 'moment';
import radium from 'radium';
import styles from './styles';

function renderStatusColor(state) {
  return Object.assign({}, styles.storyDetail, {
    background: statusColors[state].bg,
    color: statusColors[state].text,
    margin: 'auto 0 auto auto',
  });
}

const StoryCard = props => (
  <a href={`https://pivotaltracker.com/n/projects/${props.projectId}/stories/${props.story.id}`} target="_blank" key={props.storyIndex} style={styles.storyCard} onClick={() => props.onClick(props.story)}>
    <ul style={styles.storyDetails}>
      <li
        data-tip="Click to copy to clipboard"
        className="storyId"
        style={Object.assign({}, styles.storyDetail, {
          fontFamily: 'Source Code pro',
        })}
        data-clipboard-text={props.story.id}
      >
        <Icon icon="content_copy" style={{ marginRight: 5 }} />
        {props.story.id}
      </li>
      <li style={styles.storyDetail}>
        <Icon icon={typeIcons[props.story.story_type]} style={{ marginRight: 5 }} />
        {props.story.story_type}
      </li>
      <li style={renderStatusColor(props.story.current_state)}>
        {statuses.indexOf(props.story.current_state)} - {props.story.current_state}
      </li>
    </ul>
    <p style={styles.storyName}>
      {props.story.name}
    </p>
    <div style={styles.labelsWrapper}>
      {props.story.labels.length ? props.story.labels.map((label, labelIndex) => (
        <span data-tip={props.labelFilters.includes(label.id) ? `Remove "${label.name}" from filter` : `Add "${label.name}" to filter`} key={`${props.storyIndex}-${labelIndex}`} style={styles.labelItem} onClick={() => props.handleLabelChange(label.id)}>{label.name}</span>
      )) : false}
    </div>
    <span style={styles.lastUpdated}>Last updated {moment(props.story.updated_at).fromNow()}</span>
    <ReactTooltip effect="solid" place="top" />
  </a>
);

StoryCard.propTypes = {
  story: React.PropTypes.object,
{'fraction_non_alphanumeric': 0.17189030362389815, 'fraction_numerical': 0.0014691478942213516, 'mean_word_length': 3.5288248337028825, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 53, 'https://': 1, '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': '7639147', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1276, 'n_words': 249}