UNPKG

cluedin-widget

Version:

This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.

53 lines (44 loc) 2.24 kB
import React, { Component } from 'react'; import ProviderIcons from '../entityRelated/providerIcons.jsx'; import EntityIcon from '../entityRelated/EntityIcon.jsx'; import EntityLink from '../entityRelated/EntityLink.jsx'; import EntityLogo from '../entityRelated/EntityLogo.jsx'; import { makeNoValueRow, makePropHtml, findFromKey, makeLinkHtml, makeGmapLink } from '../../helpers/properties.jsx'; import SocialProperties from '../entityRelated/SocialProperties.jsx'; import EntityDate from '../entityRelated/EntityDate.jsx'; var noWebsite = makeNoValueRow('Website'); var noLocation = makeNoValueRow('Location'); var noIndustry = makeNoValueRow('Industry'); var noNbEmployee = makeNoValueRow('Number Employee'); export default class Organization extends Component { render() { const { entity, openInNewTab } = this.props; var websiteProp = findFromKey(entity.properties, 'website'); var locationProp = findFromKey(entity.properties, 'location'); var industryProp = findFromKey(entity.properties, 'industry'); var nbemployeeProp = findFromKey(entity.properties, 'nbemployee'); let websiteHtml = websiteProp ? makeLinkHtml(websiteProp) : noWebsite; let locationHtml = locationProp ? makeGmapLink(locationProp) : noLocation; let industryHtml = industryProp ? makePropHtml(industryProp) : noIndustry; let nbemployeeHtml = nbemployeeProp ? makePropHtml(nbemployeeProp) : noNbEmployee; let IconHtml = (<EntityIcon entityType={entity.data.entityType}></EntityIcon>); if (entity.hasLogo) { IconHtml = (<EntityLogo url={entity.logoUrl}></EntityLogo>); } else { IconHtml = <EntityIcon entityType={entity.data.entityType}></EntityIcon>; } //<ProviderIcons providers={entity.providers}></ProviderIcons> return ( <div className="cluedIn_entity_row"> <div className="cluedIn_entity_row_sub"> {IconHtml} <EntityLink openInNewTab={openInNewTab} entity={entity}></EntityLink> <EntityDate entity={entity}></EntityDate> </div> <div className="cluedIn_row cluedIn_row_notCentered cluedIn_entity_table"> <SocialProperties properties={entity.social}></SocialProperties> </div> </div> ); } }