UNPKG

@carbon/ibm-security

Version:

Carbon for Cloud & Cognitive IBM Security UI components

26 lines (24 loc) 665 B
/** * @file Panel controller. * @copyright IBM Security 2019 */ import PropTypes from 'prop-types'; /** * Panel controller component. * @param {Record<string, any>} props Panel controller props. * @returns {PanelController} Panel controller instance. */ var PanelController = function PanelController(props) { return props.active ? props.children : null; }; PanelController.defaultProps = { active: false, children: undefined }; PanelController.propTypes = { /** @type {boolean} Set to true to render the children. */ active: PropTypes.bool, /** @type {ReactNode} Child elements. */ children: PropTypes.node }; export default PanelController;