'use client';

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

//#region src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx
const VersionSwitcherContext = createContext({
	versions: [],
	selectedVersion: null,
	setSelectedVersion: () => {}
});
const useVersionSwitcher = () => useContext(VersionSwitcherContext);
const VersionSwitcherProvider = ({ versions, defaultSelectedVersion, children }) => {
	const [selectedVersion, setSelectedVersion] = usePersistedStore("version-selector", defaultSelectedVersion);
	return /* @__PURE__ */ jsx(VersionSwitcherContext, {
		value: {
			versions,
			selectedVersion,
			setSelectedVersion
		},
		children
	});
};

//#endregion
export { VersionSwitcherProvider, useVersionSwitcher };
//# sourceMappingURL=VersionSwitcherContext.mjs.map