import { createContext, useContext, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
//#region ../widgets/src/contexts/WidgetInteractionContext.tsx
const WidgetInteractionContext = createContext({});
function WidgetInteractionProvider({ onItemClick, onNavigate, buildHref, children }) {
	const value = useMemo(() => {
		const ctx = {};
		if (onItemClick) ctx.onItemClick = onItemClick;
		if (onNavigate) ctx.onNavigate = onNavigate;
		if (buildHref) ctx.buildHref = buildHref;
		return ctx;
	}, [
		onItemClick,
		onNavigate,
		buildHref
	]);
	return /* @__PURE__ */ jsx(WidgetInteractionContext.Provider, {
		value,
		children
	});
}
function useWidgetInteraction() {
	return useContext(WidgetInteractionContext);
}
//#endregion
export { useWidgetInteraction as n, WidgetInteractionProvider as t };

//# sourceMappingURL=WidgetInteractionContext-D8HZx_Gf.mjs.map