'use strict';

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

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _class, _temp;

var _react = require('react');

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var IfFeature = (_temp = _class = function (_Component) {
  (0, _inherits3.default)(IfFeature, _Component);

  function IfFeature() {
    (0, _classCallCheck3.default)(this, IfFeature);
    return (0, _possibleConstructorReturn3.default)(this, (IfFeature.__proto__ || Object.getPrototypeOf(IfFeature)).apply(this, arguments));
  }

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

      return this.props.children;
    }
  }]);
  IfFeature.displayName = 'IfFeature'
  ;
  return IfFeature;
}(_react.Component), _class.propTypes = {
  children: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.node), _propTypes2.default.node]),
  isOn: _propTypes2.default.bool
}, _class.defaultProps = {
  children: null,
  isOn: false
}, _temp);
exports.default = IfFeature;