"use client";
import * as React from "react";
import { useIsoLayoutEffect } from "../../../../utils/esm/useIsoLayoutEffect.js";
import { useBaseUiId } from "../../utils/useBaseUiId.js";
import { useComboboxGroupContext } from "../group/ComboboxGroupContext.js";
import { useRenderElement } from "../../utils/useRenderElement.js";
const ComboboxGroupLabel = /* @__PURE__ */ React.forwardRef(function ComboboxGroupLabel2(componentProps, forwardedRef) {
  const {
    render,
    className,
    id: idProp,
    ...elementProps
  } = componentProps;
  const {
    setLabelId
  } = useComboboxGroupContext();
  const id = useBaseUiId(idProp);
  useIsoLayoutEffect(() => {
    setLabelId(id);
    return () => {
      setLabelId(void 0);
    };
  }, [id, setLabelId]);
  const element = useRenderElement("div", componentProps, {
    ref: forwardedRef,
    props: [{
      id
    }, elementProps]
  });
  return element;
});
if (process.env.NODE_ENV !== "production") ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
export {
  ComboboxGroupLabel
};
//# sourceMappingURL=ComboboxGroupLabel.js.map
