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.

63 lines (56 loc) 1.96 kB
import React, { Component } from 'react'; import Alert from '../../../core/components/generics/alert.jsx'; import RaisedButton from 'material-ui/RaisedButton'; export default class EntityAskForLeadMessage extends Component { openDialogHandler() { const { onAskForLeadClick } = this.props; if (onAskForLeadClick) { onAskForLeadClick(); } } render() { const { entityName, entityId, askForLeads, connectivity, inLine } = this.props; let hasLead; let hasLeadDone = false; let buttonLineStyle = { marginLeft: '5px', display: 'block', marginTop: '10px', width: '250px', lineHeight: '36px', }; if (askForLeads && askForLeads.length > 0) { hasLead = askForLeads.find((lead) => { return lead.entityId === entityId; }); hasLeadDone = (hasLead && hasLead.done); } if (inLine) { buttonLineStyle = Object.assign({}, buttonLineStyle, { display: 'inline-block', marginTop: '0', marginLeft: '15px', }); } if (hasLead && !hasLeadDone) { return ( <div style={{marginBottom: '10px'}}> <Alert> <span> <b>{hasLead.userName}</b>&nbsp;requested a lead generation. CluedIn is currently looking information about <b>{entityName}</b>, this can take few hours. You will receive an email when CluedIn has finished the investigation. </span> </Alert> </div> ) } else if (!hasLead || !hasLeadDone) { return ( <div style={{marginBottom: '10px'}}> <Alert showClose={true}> <span style={{marginRight: '5px'}}>You have very few information about {entityName}</span> <RaisedButton style={buttonLineStyle} onTouchTap={this.openDialogHandler.bind(this)} label="Qualify Lead" /> </Alert> </div> ); } else { return (<span></span>); } } };