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.

42 lines (34 loc) 1.27 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}></RefreshIndicator>; loadingStyle = { opacity: 0.4 }; } content = ( <Widget> <div className="cluedIn_entity_list cluedIn_searchResult"> { searchResult.Hits.map( ( entity, i )=> { return <DefaultEntity entity={entity} key={i}></DefaultEntity> } ) } </div> </Widget> ); return ( <div style={{position: 'relative'}}> {loadingContent} <div style={loadingStyle}>{ content }</div> </div> ); } }