<commit_before>// @flow

import React from 'react';
import styles from './Company.css';
import { Content } from 'app/components/Content';
import LoadingIndicator from 'app/components/LoadingIndicator';
import { Image } from 'app/components/Image';
import InfoBubble from 'app/components/InfoBubble';
import { Link } from 'react-router';
import truncateString from 'app/utils/truncateString';
import { eventTypes } from 'app/routes/events/utils';
import Time from 'app/components/Time';
import NavigationTab from 'app/components/NavigationTab';
import NavigationLink from 'app/components/NavigationTab/NavigationLink';
import { jobType, Year } from 'app/routes/joblistings/components/Items';

type Props = {
  company: Object,
  companyEvents: Array<Object>,
  joblistings: Array<Object>
};

function insertInfoBubbles(company) {
  const infos = [
    ['call', company.phone, 'Telefon'],
    ['at', company.website, 'Nettside'],
    ['home', company.address, 'Addresse'],
    ['briefcase', company.companyType, 'Type bedrift']
  ];

  return (
    <div className={styles.infoBubbles}>
      {infos.map((info, i) => (
        <InfoBubble
          key={info[0]}
          icon={info[0]}
          data={info[1]}
          meta={info[2]}
          style={{ order: i }}
          link={info[1] && info[1].includes('.') ? info[1] : undefined}
          small
          iconClass={styles.icon}
          dataClass={styles.data}
        />
      ))}
    </div>
  );
}

const CompanyDetail = (props: Props) => {
  const { company, companyEvents, joblistings } = props;
  if (!company) {
    return <LoadingIndicator loading />;
  }
  const events =
    companyEvents &&
    companyEvents
      .sort((a, b) => new Date(b.startTime) - new Date(a.startTime))
      .map((event, i) => (
        <tr key={i}>
          <td>
            <Link to={`events/${event.id}`}>{event.title}</Link>
          </td>
          <td>{eventTypes[event.eventType]}</td>
          <td><commit_msg>Fix event links on companydetail page<commit_after>// @flow

import React from 'react';
import styles from './Company.css';
import { Content } from 'app/components/Content';
import LoadingIndicator from 'app/components/LoadingIndicator';
import { Image } from 'app/components/Image';
import InfoBubble from 'app/components/InfoBubble';
import { Link } from 'react-router';
import truncateString from 'app/utils/truncateString';
import { eventTypes } from 'app/routes/events/utils';
import Time from 'app/components/Time';
import NavigationTab from 'app/components/NavigationTab';
import NavigationLink from 'app/components/NavigationTab/NavigationLink';
import { jobType, Year } from 'app/routes/joblistings/components/Items';

type Props = {
  company: Object,
  companyEvents: Array<Object>,
  joblistings: Array<Object>
};

function insertInfoBubbles(company) {
  const infos = [
    ['call', company.phone, 'Telefon'],
    ['at', company.website, 'Nettside'],
    ['home', company.address, 'Addresse'],
    ['briefcase', company.companyType, 'Type bedrift']
  ];

  return (
    <div className={styles.infoBubbles}>
      {infos.map((info, i) => (
        <InfoBubble
          key={info[0]}
          icon={info[0]}
          data={info[1]}
          meta={info[2]}
          style={{ order: i }}
          link={info[1] && info[1].includes('.') ? info[1] : undefined}
          small
          iconClass={styles.icon}
          dataClass={styles.data}
        />
      ))}
    </div>
  );
}

const CompanyDetail = (props: Props) => {
  const { company, companyEvents, joblistings } = props;
  if (!company) {
    return <LoadingIndicator loading />;
  }
  const events =
    companyEvents &&
    companyEvents
      .sort((a, b) => new Date(b.startTime) - new Date(a.startTime))
      .map((event, i) => (
        <tr key={i}>
          <td>
            <Link to={`/events/${event.id}`}>{event.title}</Link>
          </td>
          <td>{eventTypes[event.eventType]}</td>
          <td>
{'fraction_non_alphanumeric': 0.15778843726331734, 'fraction_numerical': 0.0035344609946983086, 'mean_word_length': 3.0552712384851586, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 39, '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': '2265253', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1220, 'n_words': 274}