'use client';


const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
const require_IntlayerProvider = require('./IntlayerProvider.cjs');
const require_getDictionary = require('../getDictionary.cjs');
let react = require("react");

//#region ../react-intlayer/dist/esm/client/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 client context
*/
const useDictionary = (dictionary, locale) => {
	const { locale: currentLocale } = (0, react.useContext)(require_IntlayerProvider.IntlayerClientContext);
	return (0, react.useMemo)(() => {
		return require_getDictionary.getDictionary(dictionary, locale ?? currentLocale);
	}, [
		dictionary,
		currentLocale,
		locale
	]);
};

//#endregion
exports.useDictionary = useDictionary;
//# sourceMappingURL=useDictionary.cjs.map