import React from 'react'; import classNames from 'classnames'; import {IPropsWidgetHeading} from 'superdesk-api'; import {widgetReactIntegration} from 'apps/authoring/widgets/widgets'; /** * This component is exposed to superdesk-api to enable extensions * to use a heading that supports sliding toolbar actions. * * It also encapsulates widget actions like pinning * without exposing the implementation details to extensions. */ export class WidgetHeading extends React.PureComponent { render() { const widget = widgetReactIntegration.getActiveWidget(); const {pinWidget} = widgetReactIntegration; return (
{this.props.widgetName}
{ this.props.editMode && (
{this.props.children}
) }
); } }