'use client';

import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
import { createContext, useContext } from "react";
import { jsx } from "react/jsx-runtime";
import { useLocale } from "react-intlayer";

//#region src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.tsx
const LocaleSwitcherContentContext = createContext({
	availableLocales: [],
	selectedLocales: [],
	setSelectedLocales: () => {}
});
const useLocaleSwitcherContent = () => useContext(LocaleSwitcherContentContext);
const LocaleSwitcherContentProvider = ({ availableLocales, defaultSelectedLocales, children }) => {
	const { locale } = useLocale();
	const [selectedLocales, setSelectedLocales] = usePersistedStore("locale-content-selector-selected-locales", defaultSelectedLocales ?? [locale]);
	return /* @__PURE__ */ jsx(LocaleSwitcherContentContext, {
		value: {
			availableLocales,
			selectedLocales,
			setSelectedLocales
		},
		children
	});
};

//#endregion
export { LocaleSwitcherContentProvider, useLocaleSwitcherContent };
//# sourceMappingURL=LocaleSwitcherContentContext.mjs.map