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.

28 lines (23 loc) 939 B
import React, { Component } from 'react'; import { FormattedMessage } from 'react-intl'; export default class FollowStats extends Component { render() { const { entity, shouldAddFollowerEntityId, shouldRemoveFollowerEntityId } = this.props; let numberOfFollowers = entity.NumberOfFollowers; if ( shouldAddFollowerEntityId === entity.id ) { numberOfFollowers += 1; } if ( shouldRemoveFollowerEntityId === entity.id ) { numberOfFollowers -= 1; } if ( numberOfFollowers < 0 ) { numberOfFollowers = 0; } return (<div className="cluedIn_following_info"> <span className="cluedIn_following_info_number">{numberOfFollowers}</span> <span className="cluedIn_following_info_title"> <FormattedMessage id='Generic.Followers'></FormattedMessage> </span> </div>); } };