import { getDictionary } from "../getDictionary.mjs";
import { getServerContext } from "./serverContext.mjs";
import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";

//#region ../react-intlayer/dist/esm/server/useDictionary.mjs
/**
* On the server side, Hook that transform a dictionary and return the content
*
* If the locale is not provided, it will use the locale from the server context
*/
const useDictionary = (dictionary, locale) => {
	return getDictionary(dictionary, locale ?? getServerContext(IntlayerServerContext));
};

//#endregion
export { useDictionary };
//# sourceMappingURL=useDictionary.mjs.map