@coder/backstage-plugin-coder
Version:
Create and manage Coder workspaces from Backstage
23 lines (20 loc) • 643 B
JavaScript
import { jsx } from 'react/jsx-runtime';
import { createContext, useContext } from 'react';
const AppConfigContext = createContext(null);
function useCoderAppConfig() {
const value = useContext(AppConfigContext);
if (value === null) {
throw new Error(
`Hook ${useCoderAppConfig.name} must be called from a CoderProvider component`
);
}
return value;
}
const CoderAppConfigProvider = ({
children,
appConfig
}) => {
return /* @__PURE__ */ jsx(AppConfigContext.Provider, { value: appConfig, children });
};
export { CoderAppConfigProvider, useCoderAppConfig };
//# sourceMappingURL=CoderAppConfigProvider.esm.js.map