import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from "react";
import { connect } from "../../../../redux";
import styled from "styled-components";
import { isPluginActive } from "../../../../selectors";
var Wrapper = /*#__PURE__*/styled("div", {
  target: "e1v6yedy0",
  label: "Wrapper"
})({
  padding: 0,
  boxSizing: "border-box",
  ".mdc-tab-content": {
    padding: 15
  },
  ".mdc-layout-grid": {
    padding: 0,
    "&.no-bottom-padding": {
      paddingBottom: 0
    },
    ".mdc-layout-grid__inner": {
      gridGap: 0,
      '[class*="mdc-layout-grid__cell--span-"]': {
        display: "flex",
        alignItems: "center",
        color: "var(--mdc-theme-text-secondary-on-background)",
        marginBottom: 10,
        justifyContent: "flex-end",
        '[class*="mdc-typography--"], .mdc-button__icon': {
          lineHeight: "120%",
          width: "100%"
        },
        ".mdc-button__icon": {
          marginRight: 20
        }
      }
    }
  }
});

var Menu = /*#__PURE__*/function (_React$Component) {
  _inherits(Menu, _React$Component);

  var _super = _createSuper(Menu);

  function Menu() {
    var _this;

    _classCallCheck(this, Menu);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "ref", /*#__PURE__*/React.createRef());

    return _this;
  }

  _createClass(Menu, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          plugin = _this$props.plugin,
          options = _this$props.options;
      var content = plugin.renderMenu({
        options: options
      });
      return /*#__PURE__*/React.createElement(Wrapper, null, content);
    }
  }]);

  return Menu;
}(React.Component);

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

export default connect(function (state, props) {
  return {
    active: isPluginActive(props.plugin.name)(state)
  };
}, mapDispatchToProps)(Menu);
//# sourceMappingURL=Menu.js.map