mirror of
https://github.com/apache/superset.git
synced 2026-04-09 19:35:21 +00:00
* rename /explorev2/ -> /explore/ * add redirect for existing explorev2 urls * fix long line * remove extra line * fix missed ref in spec
48 lines
1.0 KiB
JavaScript
48 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Panel } from 'react-bootstrap';
|
|
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
|
|
const propTypes = {
|
|
label: PropTypes.string,
|
|
description: PropTypes.string,
|
|
tooltip: PropTypes.string,
|
|
children: PropTypes.node.isRequired,
|
|
};
|
|
|
|
const defaultProps = {
|
|
label: null,
|
|
description: null,
|
|
tooltip: null,
|
|
};
|
|
|
|
export default class ControlPanelSection extends React.Component {
|
|
renderHeader() {
|
|
const { label, tooltip } = this.props;
|
|
let header;
|
|
if (label) {
|
|
header = (
|
|
<div>
|
|
{label}
|
|
{tooltip && <InfoTooltipWithTrigger label={label} tooltip={tooltip} />}
|
|
</div>
|
|
);
|
|
}
|
|
return header;
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Panel
|
|
className="control-panel-section"
|
|
header={this.renderHeader()}
|
|
>
|
|
{this.props.children}
|
|
</Panel>
|
|
);
|
|
}
|
|
}
|
|
|
|
ControlPanelSection.propTypes = propTypes;
|
|
ControlPanelSection.defaultProps = defaultProps;
|