import React from "react";
import { connect } from "../../redux";
import { withActiveElement } from "../../components";
import { css } from "emotion";
var backgroundStyle = /*#__PURE__*/css({
  position: "absolute",
  top: 0,
  left: 0,
  width: "100%",
  minHeight: '100%'
}, "label:backgroundStyle;");

var Background = function Background(_ref) {
  var element = _ref.element,
      deactivateElement = _ref.deactivateElement,
      highlightElement = _ref.highlightElement;
  return /*#__PURE__*/React.createElement("div", {
    className: backgroundStyle,
    onMouseOver: function onMouseOver() {
      return highlightElement({
        element: null
      });
    },
    onClick: function onClick() {
      return element && deactivateElement();
    }
  });
};

var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    highlightElement: function highlightElement(payload) {
      dispatch({
        type: 'ui/highlightElement',
        payload: payload
      });
    },
    deactivateElement: function deactivateElement(payload) {
      dispatch({
        type: 'ui/deactivateElement',
        payload: payload
      });
    }
  };
};

export default connect(null, mapDispatchToProps)(withActiveElement()(Background));
//# sourceMappingURL=Background.js.map