import { createContext, use } from "react";
//#region ../../platform/i18n/src/translation-api-context-factory.ts
function createTranslationContext(domainName) {
	const Ctx = createContext(null);
	function useTranslation() {
		const api = use(Ctx);
		if (!api) throw new Error(`use${domainName}Translation must be used within a ${domainName}TranslationProvider`);
		return api;
	}
	return {
		Context: Ctx,
		Provider: Ctx.Provider,
		useTranslation
	};
}
//#endregion
export { createTranslationContext as t };

//# sourceMappingURL=translation-api-context-factory-dNziJNS1.mjs.map