import React, { Component, createContext } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { createClassNames } from '../core/utils'; const cx = createClassNames('Panel'); export const { Consumer: PanelConsumer, Provider: PanelProvider } = createContext(function setCanRefine() {}); class Panel extends Component { static propTypes = { children: PropTypes.node.isRequired, className: PropTypes.string, header: PropTypes.node, footer: PropTypes.node, }; static defaultProps = { className: '', header: null, footer: null, }; state = { canRefine: true, }; setCanRefine = (nextCanRefine) => { this.setState({ canRefine: nextCanRefine }); }; render() { const { children, className, header, footer } = this.props; const { canRefine } = this.state; return (