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

//#region ../react-intlayer/dist/esm/server/useIntlayer.mjs
/**
* On the server side, Hook that picking one dictionary by its key and return the content
*
* If the locale is not provided, it will use the locale from the server context
*/
const useIntlayer = (key, locale) => {
	return getIntlayer(key, locale ?? getServerContext(IntlayerServerContext));
};

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