import { createContext, useContext, useCallback, createElement } from "react";
import { useEnvironment } from "@contember/binding";
const LabelMiddlewareContext = createContext((it) => it);
const useLabelMiddleware = () => {
  const env = useEnvironment();
  const labelMiddleware = useContext(LabelMiddlewareContext);
  return useCallback((it) => labelMiddleware(it, env), [env, labelMiddleware]);
};
const LabelMiddlewareProvider = ({ value, children }) => {
  return /* @__PURE__ */ createElement(LabelMiddlewareContext.Provider, {
    value
  }, children);
};
export { LabelMiddlewareContext, LabelMiddlewareProvider, useLabelMiddleware };
//# sourceMappingURL=LabelMiddleware.js.map
