cluedin-widget
Version:
This is the project for creating and managing widgets in CluedIn.
33 lines (29 loc) • 928 B
JSX
import React, { Component } from 'react';
export default class Widget extends Component {
render() {
const { title, minHeight } = this.props;
let widgetClassName = "cluedIn_widget";
var widgetStyle = {
minHeight: minHeight ? minHeight : 'auto'
};
if ( title ) {
return (
<div style={widgetStyle} className={widgetClassName}>
<div className=" cluedIn_widget_title">
{title}
</div>
<div className=" cluedIn_widget_content">
{this.props.children}
</div>
</div>
)
} else {
return (<div style={widgetStyle} className=" cluedIn_widget">
{this.props.children}
</div>)
}
}
}
Widget.propTypes = {
title: React.PropTypes.string
};