require("./chunk-9hOWP6kD.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/shell/AppNavigationContext.tsx
const AppNavigationContext = (0, react.createContext)(null);
function AppNavigationProvider({ currentSlug, basePath, navigate, children }) {
	const buildHref = (0, react.useMemo)(() => {
		return (slug) => {
			if (basePath === "/") return `/${slug}`;
			return `${basePath}/${slug}`;
		};
	}, [basePath]);
	const value = (0, react.useMemo)(() => ({
		currentSlug,
		basePath,
		navigate,
		buildHref
	}), [
		currentSlug,
		basePath,
		navigate,
		buildHref
	]);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppNavigationContext.Provider, {
		value,
		children
	});
}
function useAppNavigation() {
	const ctx = (0, react.useContext)(AppNavigationContext);
	if (!ctx) throw new Error("useAppNavigation must be used within an <AppShell> or <AppNavigationProvider>");
	return ctx;
}
//#endregion
Object.defineProperty(exports, "AppNavigationProvider", {
	enumerable: true,
	get: function() {
		return AppNavigationProvider;
	}
});
Object.defineProperty(exports, "useAppNavigation", {
	enumerable: true,
	get: function() {
		return useAppNavigation;
	}
});

//# sourceMappingURL=AppNavigationContext-C1-hd9Rw.cjs.map