<commit_before>/* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { useQuery } from '@apollo/react-hooks';
import { statsAuthorsQueryTop30, statsGlobalQuery } from '../../graphql/queries';
import Wrapper from '../layout/Wrapper';
import { ChevronRight, Code, Flag, Folder, Mail } from './../primitives/Icon';
import Card from '../primitives/Card/Card';
import { isNotEmptyArray } from '../../utils/isEmptyUtil';
import { getDate } from '../../utils/getDateUtil';
import { getNameFromEmail } from '../../utils/getNameFromEmailUtil';
import { thousandify } from '../../utils/thousandifyUtil';

const DatesFromUntil = ({ from, until }) => (
  <>
    {from && until ? (
      <div>
        <span>{getDate(from)}</span> - <span>{getDate(until)}</span>
      </div>
    ) : null}
  </>
);

const renderContributors = ({ statsAuthors }) => {
  const output = [];
  if (statsAuthors && isNotEmptyArray(statsAuthors)) {
    statsAuthors.map(sa => {
      const {
        author,
        commitDateLast: commitDateLastAuthor,
        commits: commitsAuthor,
        // daysActive,
        // daysSinceLastCommit,
        // impact,
        // impactRatio,
        repositories: repositoriesAuthor,
        staleness,
      } = sa;
      output.push(
        <li key={uuidv4()}>
          <a href="#" className="block hover:bg-gray-50">
            <div className="flex items-center px-4 py-4 sm:px-6">
              <div className="min-w-0 flex-1 flex items-center">
                <div className="flex-shrink-0">
                  <img
                    className="h-12 w-12 rounded-full"
                    src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
                    alt=""
                  />
                </div>
                <div className="min-w-0 flex-1 px-4 md:grid md:grid-cols-2 md:gap-4">
                  <div>
                    <p className="text-sm font-medium text-indigo-600 truncate">
                      {getNameFromEmail(author)}
                    </p>
                    <p className="mt-2 flex items-center text-sm text-gray-500">
                      <Mail className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400" />
                      <span className="truncate">{author}</span>
                    </p>
                  </div>
                  <div className="hidden md:block">
                    <div>
                      <p className="text-sm text-gray-900">
                        <span className="text-gray-400">Last commit: </span>
                        <time dateTime="2020-01-07">{getDate(commitDateLastAuthor)}</time>
                      </p>
                      {/* <p className="mt-2 flex items-center text-sm text-gray-500">
                        <CheckCircle className="flex-shrink-0 mr-1.5 h-5 w-5 text-green-400" />
                        Completed phone screening
                      </p> */}
                      <p className="mt-2 flex items-center text-sm text-gray-500">
                        <Code className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-green-dark" />
                        <span className="mr-3">{commitsAuthor}</span>
                        <Folder className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-purple-middle" />
                        <span className="mr-3">{repositoriesAuthor}</span>
                        <Flag className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-pink-shock" />
                        {staleness.toFixed(2)}
                      </p>
                    </div>
                  </div>
                </div>
              </div><commit_msg>:eyes: Add more details to the 'contributors' page<commit_after>/* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { useQuery } from '@apollo/react-hooks';
import { statsAuthorsQueryTop30, statsGlobalQuery } from '../../graphql/queries';
import Wrapper from '../layout/Wrapper';
import { Calendar, ChevronRight, Code, Flag, Folder, Mail, TrendingUp } from './../primitives/Icon';
import Card from '../primitives/Card/Card';
import { isNotEmptyArray } from '../../utils/isEmptyUtil';
import { getDate } from '../../utils/getDateUtil';
import { getNameFromEmail } from '../../utils/getNameFromEmailUtil';
import { thousandify } from '../../utils/thousandifyUtil';

const DatesFromUntil = ({ from, until }) => (
  <>
    {from && until ? (
      <div>
        <span>{getDate(from)}</span> - <span>{getDate(until)}</span>
      </div>
    ) : null}
  </>
);

const renderContributors = ({ statsAuthors }) => {
  const output = [];
  if (statsAuthors && isNotEmptyArray(statsAuthors)) {
    statsAuthors.map(sa => {
      const {
        author,
        commitDateLast: commitDateLastAuthor,
        commits: commitsAuthor,
        daysActive,
        // daysSinceLastCommit,
        // impact,
        impactRatio,
        repositories: repositoriesAuthor,
        staleness,
      } = sa;
      output.push(
        <li key={uuidv4()}>
          <a href="#" className="block hover:bg-gray-50">
            <div className="flex items-center px-4 py-4 sm:px-6">
              <div className="min-w-0 flex-1 flex items-center">
                <div className="flex-shrink-0">
                  <img
                    className="h-12 w-12 rounded-full"
                    src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
                    alt=""
                  />
                </div>
                <div className="min-w-0 flex-1 px-4 md:grid md:grid-cols-2 md:gap-4">
                  <div>
                    <p className="text-sm font-medium text-indigo-600 truncate">
                      {getNameFromEmail(author)}
                    </p>
                    <p className="mt-2 flex items-center text-sm text-gray-500">
                      <Mail className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400" />
                      <span className="truncate">{author}</span>
                    </p>
                  </div>
                  <div className="hidden md:block">
                    <div>
                      <p className="text-sm text-gray-900">
                        <span className="text-gray-400">Last commit: </span>
                        <time dateTime="2020-01-07">{getDate(commitDateLastAuthor)}</time>
                      </p>
                      {/* <p className="mt-2 flex items-center text-sm text-gray-500">
                        <CheckCircle className="flex-shrink-0 mr-1.5 h-5 w-5 text-green-400" />
                        Completed phone screening
                      </p> */}
                      <p className="mt-2 flex items-center text-sm text-gray-500">
                        <Code className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-green-dark" />
                        <span className="mr-3">{commitsAuthor}</span>
                        <Folder className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-purple-middle" />
                        <span className="mr-3">{repositoriesAuthor}</span>
                        <Calendar className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-green-light" />
                        <span className="mr-3">{daysActive}</span>
                        <TrendingUp className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-turquoise" />
                        <span className="mr-3">{impactRatio.toFixed(0)}</span>
                        <Flag className="flex-shrink-0 mr-1.5 h-5 w-5 text-fav-pink-shock" />
                        <span className="mr-3">{staleness.toFixed(2)}</span>
                      </p>
                    </div>
                  </div>
                </div>
              </div>
{'fraction_non_alphanumeric': 0.1483495636777539, 'fraction_numerical': 0.03187049449854559, 'mean_word_length': 1.6004603748766852, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 115, 'https://': 2, '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': '7653088', 'n_tokens_mistral': 2519, 'n_tokens_neox': 2310, 'n_words': 445}