<commit_before>/** @jsx React.DOM */

(function() {
  var Avatar = require('../avatar.js.jsx');
  var NewsFeedItemBounty = require('./news_feed_item_bounty.js.jsx');
  var NewsFeedItemIntroduction = require('./news_feed_item_introduction.js.jsx');
  var NewsFeedItemPost = require('./news_feed_item_post.js.jsx');
  var NewsFeedItemComments = require('./news_feed_item_comments.js.jsx');
  var ONE_DAY = 24 * 60 * 60 * 1000;

  var NewsFeedItem = React.createClass({
    propTypes: {
      product: React.PropTypes.object.isRequired,
      target: React.PropTypes.object,
      user: React.PropTypes.object.isRequired
    },

    typeMap: {
      task: 'bounty',
      team_membership: 'team member'
    },

    render: function() {
      return (
        <div>
          {this.renderHeader()}
          <div className="bg-white mb4 rounded overflow-hidden shadow">
            {this.renderTarget()}
            <NewsFeedItemComments item={this.props} />
          </div>
        </div>
      );
    },

    renderHeader: function() {
      var user = this.props.user;
      var product = this.props.product;
      var target = this.props.target;

      return (
        <div className="clearfix h6 mt0 mb2">
          <div className="left">
            <AppIcon app={this.props.product} size={42} />
          </div>
          <div className="overflow-hidden p2">
            A new <a href={target.url}>{this.targetNoun(target.type)}</a>
            {' '} in <a href={product.url}>{product.name}</a>
            {' '} at {moment(new Date(this.props.updated)).format('h:mm a')}
          </div>
        </div>
      );
    },


    renderTarget: function() {
      var target = this.props.target

      switch (target.type) {
        case 'task':
          return <NewsFeedItemBounty bounty={target} user={this.props.user} />;
        case 'team_membership':
          return <NewsFeedItemIntroduction introduction={target} user={this.props.user} />;
        default:
          return <NewsFeedItemPost post={target} user={this.props.user} />;
      }
    },

    targetNoun: function(type) {
      var typeMap = this.typeMap;

      if (typeMap[type]) {
        return typeMap[type];
      }

      return type;
    }
<commit_msg>Fuzzy timestamps.<commit_after>/** @jsx React.DOM */

(function() {
  var Avatar = require('../avatar.js.jsx');
  var NewsFeedItemBounty = require('./news_feed_item_bounty.js.jsx');
  var NewsFeedItemIntroduction = require('./news_feed_item_introduction.js.jsx');
  var NewsFeedItemPost = require('./news_feed_item_post.js.jsx');
  var NewsFeedItemComments = require('./news_feed_item_comments.js.jsx');
  var moment = require('moment');
  var ONE_DAY = 24 * 60 * 60 * 1000;

  var NewsFeedItem = React.createClass({
    propTypes: {
      product: React.PropTypes.object.isRequired,
      target: React.PropTypes.object,
      user: React.PropTypes.object.isRequired
    },

    typeMap: {
      task: 'bounty',
      team_membership: 'team member'
    },

    render: function() {
      return (
        <div>
          {this.renderHeader()}
          <div className="bg-white mb4 rounded overflow-hidden shadow">
            {this.renderTarget()}
            <NewsFeedItemComments item={this.props} />
          </div>
        </div>
      );
    },

    renderHeader: function() {
      var user = this.props.user;
      var product = this.props.product;
      var target = this.props.target;

      return (
        <div className="clearfix h6 mt0 mb2">
          <div className="left">
            <AppIcon app={this.props.product} size={42} />
          </div>
          <div className="overflow-hidden p2">
            A new <a href={target.url}>{this.targetNoun(target.type)}</a>
            {' '} in <a href={product.url}>{product.name}</a>
            {' '} {moment(new Date(this.props.updated)).fromNow()}
          </div>
        </div>
      );
    },


    renderTarget: function() {
      var target = this.props.target

      switch (target.type) {
        case 'task':
          return <NewsFeedItemBounty bounty={target} user={this.props.user} />;
        case 'team_membership':
          return <NewsFeedItemIntroduction introduction={target} user={this.props.user} />;
        default:
          return <NewsFeedItemPost post={target} user={this.props.user} />;
      }
    },

    targetNoun: function(type) {
      var typeMap = this.typeMap;

      if (typeMap[type]) {
        return typeMap[type];
      }

      return type;
    }

{'fraction_non_alphanumeric': 0.14521158129175946, 'fraction_numerical': 0.0075723830734966595, 'mean_word_length': 2.2949376375641966, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '6540826', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1366, 'n_words': 264}