<commit_before>import React, { Component } from 'react';
import StranickePrispevky from './StranickePrispevky';
import SponzorstvoStran from './SponzorstvoStran';
import Vztahy from './Vztahy';
import Zmluvy from './Zmluvy';
import ShowTrend from './ShowTrend';
import TabLink from './TabLink';
import { getFinancialData, extractIco, icoUrl, showNumberCurrency, showDate, isPolitician } from '../../utility/utilities';
import './Info.css';

class Info extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showRelated: false,
      showContracts: false,
    };

    this.showHideRelated = this.showHideRelated.bind(this);
    this.showHideContracts = this.showHideContracts.bind(this);
  }

  showHideRelated() {
    this.setState({
      showRelated: !this.state.showRelated,
    });
  }

  showHideContracts() {
    this.setState({
      showContracts: !this.state.showContracts,
    });
  }

  render() {
    const { data, eid } = this.props;
    const entity = data.entities[0];
    const findata = getFinancialData(data, extractIco(data));
    return (
      <div className="result">
        <span className="entityName">
          <i className={`fa fa-circle${isPolitician(data) ? ' politician' : ''}`} aria-hidden="true"></i>&nbsp;
          {entity.entity_name}&nbsp;
          <a title="Zobraz na mape" target="_blank" rel="noopener noreferrer" href={`https://verejne.digital/index.html?zobraz&${entity.lat}&${entity.lng}&${eid}&`}><i className="fa fa-map-marker" aria-hidden="true"></i></a>
        </span>
        <hr />
        <table className="dataTable table table-condensed">
          <tbody>
            <tr>
              <td colSpan="2">
                {entity.address}
              </td>
            </tr>
            {findata.ico &&
              <tr>
                <td colSpan="2"><strong>IČO:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={`http://www.orsr.sk/hladaj_ico.asp?ICO=${findata.ico}&SID=0`}
                    text={findata.ico}
                  />
                  &nbsp;(
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={'detaily o firme'}
                    />
                  )
                </td>
              </tr>
            }
            {findata.ico && findata.zaciatok &&
              <tr>
                <td colSpan="2"><strong>Založená:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={showDate(findata.zaciatok)}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.koniec &&
              <tr>
                <td colSpan="2"><strong>Zaniknutá:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={showDate(findata.koniec)}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.zamestnancov &&
              <tr>
                <td colSpan="2"><strong>Zamestnancov:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={findata.zamestnancov}
                  />
                </td>
              </tr>
            }
            {data.zrsr_data.length >= 1 &&
              <tr>
                <td colSpan="2">
                  <strong>IČO Živnostníka:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={`https://verejne.digital/zrsr.html?${data.zrsr_data[0].ico}`}
                    text={data.zrsr_data[0].ico}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.zisk15 !== undefined && findata.zisk15 !== 0 &&
              <tr>
                <td colSpan="2">
                  <span><strong>Zisk v 2015:</strong>&nbsp;
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={showNumberCurrency(findata.zisk15)}
                    />
                  </span>
                  {findata.zisk_trend !== 0 &&
                    <span title="Trend">
                      &nbsp;(<ShowTrend trend={findata.zisk_trend} isMapView={false} />)
                    </span>
                    }
                </td>
              </tr>
              }
            {findata.ico && findata.trzby15 !== undefined && findata.trzby15 !== 0 &&
              <tr>
                <td colSpan="2">
                  <span><strong>Tržby v 2015:</strong>&nbsp;
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={showNumberCurrency(findata.trzby15)}
                    />
                  </span>
                  {findata.trzby_trend !== 0 &&
                    <span title="Trend">
                      &nbsp;(<ShowTrend trend={findata.trzby_trend} isMapView={false} />)
                    </span><commit_msg>Issue #16 - Zmenit trzby a zisky 2015 na 2016 v prepojeniach<commit_after>import React, { Component } from 'react';
import StranickePrispevky from './StranickePrispevky';
import SponzorstvoStran from './SponzorstvoStran';
import Vztahy from './Vztahy';
import Zmluvy from './Zmluvy';
import ShowTrend from './ShowTrend';
import TabLink from './TabLink';
import { getFinancialData, extractIco, icoUrl, showNumberCurrency, showDate, isPolitician } from '../../utility/utilities';
import './Info.css';

class Info extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showRelated: false,
      showContracts: false,
    };

    this.showHideRelated = this.showHideRelated.bind(this);
    this.showHideContracts = this.showHideContracts.bind(this);
  }

  showHideRelated() {
    this.setState({
      showRelated: !this.state.showRelated,
    });
  }

  showHideContracts() {
    this.setState({
      showContracts: !this.state.showContracts,
    });
  }

  render() {
    const { data, eid } = this.props;
    const entity = data.entities[0];
    const findata = getFinancialData(data, extractIco(data));
    return (
      <div className="result">
        <span className="entityName">
          <i className={`fa fa-circle${isPolitician(data) ? ' politician' : ''}`} aria-hidden="true"></i>&nbsp;
          {entity.entity_name}&nbsp;
          <a title="Zobraz na mape" target="_blank" rel="noopener noreferrer" href={`https://verejne.digital/index.html?zobraz&${entity.lat}&${entity.lng}&${eid}&`}><i className="fa fa-map-marker" aria-hidden="true"></i></a>
        </span>
        <hr />
        <table className="dataTable table table-condensed">
          <tbody>
            <tr>
              <td colSpan="2">
                {entity.address}
              </td>
            </tr>
            {findata.ico &&
              <tr>
                <td colSpan="2"><strong>IČO:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={`http://www.orsr.sk/hladaj_ico.asp?ICO=${findata.ico}&SID=0`}
                    text={findata.ico}
                  />
                  &nbsp;(
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={'detaily o firme'}
                    />
                  )
                </td>
              </tr>
            }
            {findata.ico && findata.zaciatok &&
              <tr>
                <td colSpan="2"><strong>Založená:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={showDate(findata.zaciatok)}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.koniec &&
              <tr>
                <td colSpan="2"><strong>Zaniknutá:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={showDate(findata.koniec)}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.zamestnancov &&
              <tr>
                <td colSpan="2"><strong>Zamestnancov:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={icoUrl(findata.ico)}
                    text={findata.zamestnancov}
                  />
                </td>
              </tr>
            }
            {data.zrsr_data.length >= 1 &&
              <tr>
                <td colSpan="2">
                  <strong>IČO Živnostníka:</strong>&nbsp;
                  <TabLink
                    isMapView={false}
                    url={`https://verejne.digital/zrsr.html?${data.zrsr_data[0].ico}`}
                    text={data.zrsr_data[0].ico}
                  />
                </td>
              </tr>
            }
            {findata.ico && findata.zisk15 !== undefined && findata.zisk15 !== 0 &&
              <tr>
                <td colSpan="2">
                  <span><strong>Zisk v 2016:</strong>&nbsp;
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={showNumberCurrency(findata.zisk15)}
                    />
                  </span>
                  {findata.zisk_trend !== 0 &&
                    <span title="Trend">
                      &nbsp;(<ShowTrend trend={findata.zisk_trend} isMapView={false} />)
                    </span>
                    }
                </td>
              </tr>
              }
            {findata.ico && findata.trzby15 !== undefined && findata.trzby15 !== 0 &&
              <tr>
                <td colSpan="2">
                  <span><strong>Tržby v 2016:</strong>&nbsp;
                    <TabLink
                      isMapView={false}
                      url={icoUrl(findata.ico)}
                      text={showNumberCurrency(findata.trzby15)}
                    />
                  </span>
                  {findata.trzby_trend !== 0 &&
                    <span title="Trend">
                      &nbsp;(<ShowTrend trend={findata.trzby_trend} isMapView={false} />)
                    </span>
{'fraction_non_alphanumeric': 0.13670217780710853, 'fraction_numerical': 0.007919298576411804, 'mean_word_length': 1.2749303023804417, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 153, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2485267', 'n_tokens_mistral': 3196, 'n_tokens_neox': 2988, 'n_words': 455}