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.
26 lines (23 loc) • 789 B
JSX
import React, { Component } from 'react';
import config from '../../config';
import { Link } from 'react-router';
import ReactEmoji from 'react-emoji';
import Theme from '../../theme';
const EntityLinkStyle = {
color: Theme.colors.main
};
export default class EntityLink extends Component {
render() {
const { entity, openInNewTab } = this.props;
const linkUrl = config.location.goToEntity(entity);
let linkContent = (<Link style={EntityLinkStyle} to={linkUrl}> {ReactEmoji.emojify(entity.name)}</Link>);
if (openInNewTab) {
linkContent = (<Link style={EntityLinkStyle} target="_blank" to={linkUrl}> {ReactEmoji.emojify(entity.name)}</Link>);
}
return (
<div className="cluedIn_entity_row_title">
{linkContent}
</div>
);
}
};