"use strict";

exports.__esModule = true;
exports.useExtensionMenuItems = useExtensionMenuItems;
var _react = require("react");
var _ExtensionMenuItemsState = require("../state/ExtensionMenuItemsState");
var _react2 = require("@wix/bex-core/react");
function useExtensionMenuItems(params) {
  const container = (0, _react2.useWixPatternsContainer)();
  const {
    extension,
    ...stateParams
  } = params;
  const [state] = (0, _react.useState)(() => {
    return extension ?? new _ExtensionMenuItemsState.ExtensionMenuItemsState({
      ...stateParams,
      container
    });
  });
  (0, _react.useEffect)(() => {
    if (!extension) {
      return state.init();
    }
    return () => {};
  }, []);
  return state;
}
//# sourceMappingURL=useExtensionMenuItems.js.map