"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _react = require("react");
var _mobx = require("mobx");
var Panel = exports["default"] = /*#__PURE__*/function () {
  function Panel(name, config) {
    this.isPanel = true;
    this.name = void 0;
    this.config = void 0;
    this.visible = true;
    this.name = name;
    this.config = config;
    (0, _mobx.makeAutoObservable)(this, {
      isPanel: false,
      config: false,
      name: false
    });
  }
  var _proto = Panel.prototype;
  _proto.getName = function getName() {
    return this.name;
  };
  _proto.hide = function hide() {
    this.visible = false;
  };
  _proto.show = function show() {
    this.visible = true;
  };
  _proto.toggle = function toggle() {
    this.visible = !this.visible;
  };
  (0, _createClass2["default"])(Panel, [{
    key: "content",
    get: function get() {
      return /*#__PURE__*/(0, _react.createElement)(this.config.content, this.config.contentProps);
    }
  }]);
  return Panel;
}();