'use client';


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

//#region src/components/IDE/CodeContext.tsx
/**
* Context that store the current locale on the client side
*/
const CodeContext = createContext({
	packageManager: "npm",
	setPackageManager: () => {},
	codeFormat: "typescript",
	setCodeFormat: () => {},
	contentDeclarationFormat: "typescript",
	setContentDeclarationFormat: () => {}
});
/**
* Hook that provides the current locale
*/
const useCodeContext = () => useContext(CodeContext);
/**
* Provider that store the current locale on the client side
*/
const CodeProvider = ({ children }) => {
	const [packageManager, setPackageManager] = usePersistedStore("packageManager", "npm");
	const [codeFormat, setCodeFormat] = usePersistedStore("codeFormat", "typescript");
	const [contentDeclarationFormat, setContentDeclarationFormat] = usePersistedStore("contentDeclarationFormat", "typescript");
	return /* @__PURE__ */ jsx(CodeContext, {
		value: {
			packageManager,
			setPackageManager,
			codeFormat,
			setCodeFormat,
			contentDeclarationFormat,
			setContentDeclarationFormat
		},
		children
	});
};

//#endregion
export { CodeContext, CodeProvider, useCodeContext };
//# sourceMappingURL=CodeContext.mjs.map