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, children: PropTypes.node.isRequired, startExpanded: PropTypes.bool, hasErrors: PropTypes.bool, }; const defaultProps = { label: null, description: null, startExpanded: false, hasErrors: false, }; export default class ControlPanelSection extends React.Component { constructor(props) { super(props); this.state = { expanded: this.props.startExpanded }; } toggleExpand() { this.setState({ expanded: !this.state.expanded }); } renderHeader() { const { label, description, hasErrors } = this.props; return ( label &&