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.

49 lines (41 loc) 1.13 kB
import React, { Component } from 'react'; import Widget from '../generics/widget.jsx'; import DefaultEntity from '../defaultEntity.jsx'; import RefreshIndicator from 'material-ui/RefreshIndicator'; export default class SearchResult extends Component { render() { const { searchResult, isFetchingSearch } = this.props; let content; let loadingContent; let loadingStyle = {}; if (isFetchingSearch) { loadingContent = ( <RefreshIndicator size={60} left={-30} style={{marginLeft: '50%'}} status="loading" top={50} /> ); loadingStyle = { opacity: 0.4, }; } content = ( <Widget> <div className="cluedIn_entity_list cluedIn_searchResult"> {searchResult.Hits.map((entity, i) => { return (<DefaultEntity openInNewTab={true} entity={entity} key={i}/>); })} </div> </Widget> ); return ( <div style={{position: 'relative'}}> {loadingContent} <div style={loadingStyle}>{ content }</div> </div> ); } }