import * as React from 'react';
import styled from "styled-components";
import { connect } from "../../redux";
import { getActiveElement } from "../../selectors";
import { Collapse } from '@whalecloud/fdx';
import { toolCollapseAttr } from "../../utils";
var PbSettingContainer = /*#__PURE__*/styled('div', {
  target: "eun7awm0",
  label: "PbSettingContainer"
})({
  padding: 5
});

var PluginSettingContainer = function PluginSettingContainer(_ref) {
  var element = _ref.element,
      SettingComponent = _ref.component,
      updateElement = _ref.updateElement;
  return /*#__PURE__*/React.createElement(PbSettingContainer, null, /*#__PURE__*/React.createElement(Collapse, Object.assign({}, toolCollapseAttr, {
    defaultActiveKey: ['1', '2']
  }), /*#__PURE__*/React.createElement(SettingComponent, {
    element: element,
    updateElement: updateElement
  })));
};

var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    updateElement: function updateElement(payload) {
      dispatch({
        type: 'appBuilder/updateAndFlattenElement',
        payload: payload
      });
    }
  };
};

export default connect(function (state) {
  return {
    element: getActiveElement(state)
  };
}, mapDispatchToProps)(PluginSettingContainer);
//# sourceMappingURL=PbPluginSettingContainer.js.map