import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
var MenuContext = React.createContext({});
export default MenuContext;
export function connect(Component) {
  function WrappedItem(props) {
    var forwardedRef = props.forwardedRef,
        other = _objectWithoutProperties(props, ["forwardedRef"]);

    return React.createElement(MenuContext.Consumer, null, function (store) {
      var value = store.value,
          storeData = _objectWithoutProperties(store, ["value"]);

      return React.createElement(Component, _extends({}, storeData, other, {
        currentValue: value,
        ref: forwardedRef
      }));
    });
  }

  function forwardRef(props, ref) {
    return React.createElement(WrappedItem, _extends({}, props, {
      forwardedRef: ref
    }));
  } // Give this component a more helpful display name in DevTools.


  forwardRef.displayName = 'ConnectedMenuItem';
  return React.forwardRef(forwardRef);
}