import { createContext, useContext, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
//#region src/shell/AppNavigationContext.tsx
const AppNavigationContext = createContext(null);
function AppNavigationProvider({ currentSlug, basePath, navigate, children }) {
	const buildHref = useMemo(() => {
		return (slug) => {
			if (basePath === "/") return `/${slug}`;
			return `${basePath}/${slug}`;
		};
	}, [basePath]);
	const value = useMemo(() => ({
		currentSlug,
		basePath,
		navigate,
		buildHref
	}), [
		currentSlug,
		basePath,
		navigate,
		buildHref
	]);
	return /* @__PURE__ */ jsx(AppNavigationContext.Provider, {
		value,
		children
	});
}
function useAppNavigation() {
	const ctx = useContext(AppNavigationContext);
	if (!ctx) throw new Error("useAppNavigation must be used within an <AppShell> or <AppNavigationProvider>");
	return ctx;
}
//#endregion
export { useAppNavigation as n, AppNavigationProvider as t };

//# sourceMappingURL=AppNavigationContext-Dvc0yoZF.mjs.map