import * as React from 'react';
import { connect } from "../../redux";
import { ElementRoot } from "../../../render/components/ElementRoot";

var PluginContainer = function PluginContainer(_ref) {
  var element = _ref.element,
      PluginComponent = _ref.component,
      updateElement = _ref.updateElement;
  return /*#__PURE__*/React.createElement(ElementRoot, {
    element: element
  }, function (_ref2) {
    var getAllClasses = _ref2.getAllClasses,
        elementStyle = _ref2.elementStyle,
        elementAttributes = _ref2.elementAttributes;
    return /*#__PURE__*/React.createElement(PluginComponent, {
      elementId: element.id,
      element: element,
      getAllClasses: getAllClasses,
      elementStyle: elementStyle,
      elementAttributes: elementAttributes,
      updateElement: updateElement
    });
  });
};

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

export default connect(function (state) {
  return {};
}, mapDispatchToProps)(PluginContainer);
//# sourceMappingURL=PbPluginContainer.js.map