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 (24 loc) 635 B
import React, { PropTypes } from 'react'; import { removeWidget } from '../../action/core'; export default class RemovableComponent extends React.Component { static propTypes = { widgetName: PropTypes.string, layoutPosition: PropTypes.object, dispatch: PropTypes.func, }; getRemovableActions() { return [{ type: 'Action', icon: 'fa fa-trash-o', title: 'Remove Widget', onClick: this.removeWidget.bind(this), }]; } removeWidget() { const { layoutPosition, widgetName, } = this.props; this.props.dispatch(removeWidget(widgetName, layoutPosition)); } }