"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _ButtonConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/ButtonConfig"));

var _coreUtil = require("../../../../../utils/coreUtil");

var _common = require("../../../../../common");

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

var __extends = void 0 && (void 0).__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (b.hasOwnProperty(p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var AComponent =
/** @class */
function (_super) {
  __extends(AComponent, _super);

  function AComponent() {
    var _this = _super !== null && _super.apply(this, arguments) || this;

    _this.state = {};

    _this.reRender = function () {
      (0, _coreUtil.renderPreview)();

      _this.setState({});
    };

    return _this;
  }

  AComponent.prototype.render = function () {
    var panelProps = this.props.panelProps;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "recommend_content"
    }, /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
      headerSize: "middle",
      onRefresh: this.reRender,
      source: [{
        key: '1',
        name: 'Button',
        value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
          data: panelProps.button
        }),
        metaOption: panelProps.button
      }, {
        key: '2',
        name: 'Secondary Button',
        value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
          data: panelProps.secondaryButton
        }),
        metaOption: panelProps.secondaryButton
      }],
      type: "switch"
    }));
  };

  AComponent.defaultProps = {
    panelProps: {
      button: {},
      secondaryButton: {}
    }
  };
  return AComponent;
}(_react["default"].Component);

var _default = AComponent;
exports["default"] = _default;