cluedin-widget
Version:
This is the project for creating and managing widgets in CluedIn.
37 lines (32 loc) • 1.2 kB
JSX
import React, { Component } from 'react';
import Widget from '../generics/widget.jsx';
import config from '../../../core/config';
import iso from '../../../iso';
import { connect } from 'react-redux';
import DefaultEntity from '../defaultEntity.jsx';
export default class SearchResult extends Component {
render() {
let content;
const { searchResult, isFetchingSearch } = this.props;
if ( isFetchingSearch ) {
content = 'searching....';
} else if ( !searchResult || searchResult.length === 0 ) {
content = 'nothing...';
} else {
content = (
<div className="cluedIn_container">
<Widget loading={isFetchingSearch}>
<div className="cluedIn_entity_list cluedIn_searchResult">
{ searchResult.Hits.map( ( entity, i )=> {
return <DefaultEntity entity={entity} key={i}></DefaultEntity>
} ) }
</div>
</Widget>
</div>
);
}
return (
<div>{ content }</div>
);
}
}