<commit_before>/* eslint-disable no-confusing-arrow */
import React, { PropTypes } from 'react'
import { Link } from 'react-router'
import { numberToHuman } from '../../vendor/number_to_human'

export const UserNames = ({ user }) =>
  <div className="UserNames">
    <h2 className="UserUsername">
      <Link to={ `/${user.username}` } >@{user.username}</Link>
    </h2>
    <h3 className="UserName">{ user.name }</h3>
  </div>

UserNames.propTypes = {
  user: PropTypes.shape({
    name: PropTypes.string,
    username: PropTypes.string.isRequired,
  }).isRequired,
}

const UserStatsLink = ({ asDisabled = false, children, to }) =>
  asDisabled ?
    <span activeClassName="active" className="UserStatsLink asDisabled">
      { children }
    </span> :
    <Link activeClassName="active" className="UserStatsLink" to={ to }>
      { children }
    </Link>

UserStatsLink.propTypes = {
  asDisabled: PropTypes.bool,
  children: PropTypes.node,
  to: PropTypes.string,
}

export const UserStats = ({ user }) =>
  <div className="UserStats">
    <dl>
      <UserStatsLink to={ `/${user.username}` }>
        <dt>{ numberToHuman(user.postsCount) }</dt>
        <dd>Posts</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink asDisabled={ !user.followingCount } to={ `/${user.username}/following` }>
        <dt>{ numberToHuman(user.followingCount) }</dt>
        <dd>Following</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink
        asDisabled={ typeof user.followersCount === 'string' || !user.followersCount }
        to={ `/${user.username}/followers` }
      >
        <dt>
          {
            typeof user.followersCount === 'string' ?
              user.followersCount :
              numberToHuman(user.followersCount)
          }
        </dt>
        <dd>Followers</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink asDisabled={ !user.lovesCount } to={ `/${user.username}/loves` } >
        <dt>{ numberToHuman(user.lovesCount) }</dt>
        <dd>Loves</dd>
      </UserStatsLink>
    </dl>
  </div>

UserStats.propTypes = {
  user: PropTypes.shape({
    followingCount: PropTypes.number.isRequired,
    followersCount: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.number,
    ]).isRequired,
    followersCountRounded: PropTypes.string.isRequired,
    lovesCount: PropTypes.number.isRequired,
    postsCount: PropTypes.number.isRequired,<commit_msg>Remove unnecessary prop from user vitals.<commit_after>/* eslint-disable no-confusing-arrow */
import React, { PropTypes } from 'react'
import { Link } from 'react-router'
import { numberToHuman } from '../../vendor/number_to_human'

export const UserNames = ({ user }) =>
  <div className="UserNames">
    <h2 className="UserUsername">
      <Link to={ `/${user.username}` } >@{user.username}</Link>
    </h2>
    <h3 className="UserName">{ user.name }</h3>
  </div>

UserNames.propTypes = {
  user: PropTypes.shape({
    name: PropTypes.string,
    username: PropTypes.string.isRequired,
  }).isRequired,
}

const UserStatsLink = ({ asDisabled = false, children, to }) =>
  asDisabled ?
    <span activeClassName="active" className="UserStatsLink asDisabled">
      { children }
    </span> :
    <Link activeClassName="active" className="UserStatsLink" to={ to }>
      { children }
    </Link>

UserStatsLink.propTypes = {
  asDisabled: PropTypes.bool,
  children: PropTypes.node,
  to: PropTypes.string,
}

export const UserStats = ({ user }) =>
  <div className="UserStats">
    <dl>
      <UserStatsLink to={ `/${user.username}` }>
        <dt>{ numberToHuman(user.postsCount) }</dt>
        <dd>Posts</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink asDisabled={ !user.followingCount } to={ `/${user.username}/following` }>
        <dt>{ numberToHuman(user.followingCount) }</dt>
        <dd>Following</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink
        asDisabled={ typeof user.followersCount === 'string' || !user.followersCount }
        to={ `/${user.username}/followers` }
      >
        <dt>
          {
            typeof user.followersCount === 'string' ?
              user.followersCount :
              numberToHuman(user.followersCount)
          }
        </dt>
        <dd>Followers</dd>
      </UserStatsLink>
    </dl>
    <dl>
      <UserStatsLink asDisabled={ !user.lovesCount } to={ `/${user.username}/loves` } >
        <dt>{ numberToHuman(user.lovesCount) }</dt>
        <dd>Loves</dd>
      </UserStatsLink>
    </dl>
  </div>

UserStats.propTypes = {
  user: PropTypes.shape({
    followingCount: PropTypes.number.isRequired,
    followersCount: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.number,
    ]).isRequired,
    lovesCount: PropTypes.number.isRequired,
    postsCount: PropTypes.number.isRequired,
{'fraction_non_alphanumeric': 0.1576875259013676, 'fraction_numerical': 0.0016576875259013675, 'mean_word_length': 2.815810276679842, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 101, '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': '1192863', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1544, 'n_words': 292}