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.

30 lines (23 loc) 716 B
import React, { Component } from 'react'; var ObjectHelper = require('../../../iso').object; export default class Grid extends Component { renderWidget(w, index) { const { isAdmin, entityId, type } = this.props; var widgetParamsW = ObjectHelper.extend({ entityId: entityId, layoutPosition: { type: type }, isAdmin: isAdmin }, w.parameters); return (<div key={index}>{React.createElement(window.__cluedin_in[w.name].component, widgetParamsW)}</div>); } render() { const { widgets } = this.props; return (<div className="grid"> {widgets.map((widget, index)=> { return this.renderWidget(widget, index); })} </div>); } };