import _createClass from "@babel/runtime/helpers/createClass";
import { createElement } from 'react';
import { makeAutoObservable } from 'mobx';
var Widget = /*#__PURE__*/function () {
  function Widget(name, config) {
    this.name = void 0;
    this.config = void 0;
    this.visible = true;
    this.name = name;
    this.config = config;
    makeAutoObservable(this, {
      config: false,
      name: false
    });
  }
  var _proto = Widget.prototype;
  _proto.hide = function hide() {
    this.visible = false;
  };
  _proto.show = function show() {
    this.visible = true;
  };
  _proto.toggle = function toggle() {
    this.visible = !this.visible;
  };
  _createClass(Widget, [{
    key: "content",
    get: function get() {
      return /*#__PURE__*/createElement(this.config.content, this.config.contentProps);
    }
  }]);
  return Widget;
}();
export { Widget as default };