"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

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

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

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

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

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

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

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

var React = _interopRequireWildcard(require("react"));

var _rcCollapse = _interopRequireDefault(require("rc-collapse"));

var _classnames = _interopRequireDefault(require("classnames"));

var _configProvider = require("../config-provider");

var CollapsePanel = /*#__PURE__*/function (_React$Component) {
  (0, _inherits2["default"])(CollapsePanel, _React$Component);

  var _super = (0, _createSuper2["default"])(CollapsePanel);

  function CollapsePanel() {
    var _this;

    (0, _classCallCheck2["default"])(this, CollapsePanel);
    _this = _super.apply(this, arguments);

    _this.renderCollapsePanel = function (_ref) {
      var getPrefixCls = _ref.getPrefixCls;
      var _this$props = _this.props,
          customizePrefixCls = _this$props.prefixCls,
          _this$props$className = _this$props.className,
          className = _this$props$className === void 0 ? '' : _this$props$className,
          _this$props$showArrow = _this$props.showArrow,
          showArrow = _this$props$showArrow === void 0 ? true : _this$props$showArrow;
      var prefixCls = getPrefixCls('collapse', customizePrefixCls);
      var collapsePanelClassName = (0, _classnames["default"])((0, _defineProperty2["default"])({}, "".concat(prefixCls, "-no-arrow"), !showArrow), className);
      return /*#__PURE__*/React.createElement(_rcCollapse["default"].Panel, (0, _extends2["default"])({}, _this.props, {
        prefixCls: prefixCls,
        className: collapsePanelClassName
      }));
    };

    return _this;
  }

  (0, _createClass2["default"])(CollapsePanel, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement(_configProvider.ConfigConsumer, null, this.renderCollapsePanel);
    }
  }]);
  return CollapsePanel;
}(React.Component);

exports["default"] = CollapsePanel;