import { forwardRef, useContext } from "react";
import cs from "../_util/classNames.js";
import { processChildren } from "./util.js";
import MenuContext from "./context.js";
import MenuIndent from "./indent.js";
import { jsxs, jsx } from "../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
function ItemGroup(props, ref) {
  var children = props.children, title = props.title, level = props.level, className = props.className, style = props.style;
  var _a = useContext(MenuContext), prefixCls = _a.prefixCls, levelIndent = _a.levelIndent;
  var childrenLevel = level === 1 ? level + 1 : level;
  var childrenList = processChildren(children, {
    level: childrenLevel
  });
  return /* @__PURE__ */ jsxs("div", {
    ref,
    className: cs(prefixCls + "-group", className),
    style,
    children: [/* @__PURE__ */ jsxs("div", {
      className: prefixCls + "-group-title",
      children: [/* @__PURE__ */ jsx(MenuIndent, {
        level,
        prefixCls,
        levelIndent
      }), /* @__PURE__ */ jsx("span", {
        children: title
      })]
    }), childrenList]
  });
}
var ForwardRefItemGroup = forwardRef(ItemGroup);
var ItemGroupComponent = ForwardRefItemGroup;
ItemGroupComponent.displayName = "MenuItemGroup";
ItemGroupComponent.menuType = "MenuGroup";
const ItemGroup$1 = ItemGroupComponent;
export {
  ItemGroup$1 as default
};
//# sourceMappingURL=item-group.js.map
