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