cluedin-widget
Version:
This is the project for creating and managing widgets in CluedIn.
45 lines (36 loc) • 1.68 kB
JSX
import React, { Component } from 'react'
import registry from '../../core/registry'
import EntityListWidget from '../../core/components/entityRelated/EntityListWidget.jsx';
import { connect } from 'react-redux'
import { fetchGenericLastOrganizations } from '../../core/action/organization'
class LastOrganizations extends Component {
componentWillMount() {
this.fetch();
}
fetch( pageNumber ) {
this.props.dispatch( fetchGenericLastOrganizations( pageNumber ) );
}
render() {
const { isFetching, entities, isAdmin, layoutInformation, isFake, nextPageNumber } = this.props;
let entityType = '/Organization';
return (<EntityListWidget widgetName={this.constructor.name}
layoutInformation={layoutInformation}
title="Latest Companies"
fetch={this.fetch.bind(this)}
entities={entities}
isFetching={isFetching}
isAdmin={isAdmin}
entityType={entityType}
nextPageNumber={nextPageNumber}
isFake={isFake}></EntityListWidget>);
}
}
function select( state ) {
return {
entities: state.organization.genericLastOrganizations,
nextPageNumber: state.organization.nextPageNumber,
isFetching: state.organization.isFetchingGenericOrganizations,
isFake: state.organization.isFakeGenericOrganization
};
}
registry.register( 'LastOrganizations', connect( select )( LastOrganizations ) );