"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _react = require("react");

var _propTypes = _interopRequireDefault(require("prop-types"));

var IfFeature =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(IfFeature, _Component);

  function IfFeature() {
    (0, _classCallCheck2.default)(this, IfFeature);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(IfFeature).apply(this, arguments));
  }

  (0, _createClass2.default)(IfFeature, [{
    key: "render",
    value: function render() {
      if (!this.props.isOn) {
        return null;
      }

      return this.props.children;
    }
  }]);
  IfFeature.displayName = "IfFeature";
  return IfFeature;
}(_react.Component);

exports.default = IfFeature;
IfFeature.propTypes = {
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
  isOn: _propTypes.default.bool
};
IfFeature.defaultProps = {
  children: null,
  isOn: false
};