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,
      dropElement = _ref.dropElement;
  return /*#__PURE__*/React.createElement(ElementRoot, {
    element: element
  }, function (_ref2) {
    var getAllClasses = _ref2.getAllClasses,
        combineClassNames = _ref2.combineClassNames,
        elementStyle = _ref2.elementStyle,
        customClasses = _ref2.customClasses,
        elementAttributes = _ref2.elementAttributes;
    return /*#__PURE__*/React.createElement(PluginComponent, {
      elementId: element.id,
      element: element,
      getAllClasses: getAllClasses,
      combineClassNames: combineClassNames,
      elementStyle: elementStyle,
      elementAttributes: elementAttributes,
      customClasses: customClasses,
      updateElement: updateElement,
      dropElement: dropElement
    });
  });
};

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

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