import { createContext, useContext } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region ../core/src/widgets-api-context.ts
const WidgetsApiContext = createContext(null);
const WidgetsApiProvider = WidgetsApiContext.Provider;
function useWidgetsApi() {
	const api = useContext(WidgetsApiContext);
	if (!api) throw new Error("useWidgetsApi must be used within a WidgetsApiProvider");
	return api;
}
//#endregion
//#region ../react/src/data-sources/preview-context.tsx
const WidgetPreviewContext = createContext({ isPreview: false });
function useWidgetPreviewContext() {
	return useContext(WidgetPreviewContext);
}
//#endregion
//#region ../widgets/src/components/error-state.tsx
function ErrorState() {
	return /* @__PURE__ */ jsxs("div", {
		className: "flex min-h-[120px] flex-col items-center justify-center p-6 text-center",
		children: [/* @__PURE__ */ jsx("p", {
			className: "text-lg font-semibold",
			children: "Something Went Wrong"
		}), /* @__PURE__ */ jsx("p", {
			className: "text-muted-foreground text-sm",
			children: "Please contact a company admin for help"
		})]
	});
}
//#endregion
export { useWidgetsApi as i, useWidgetPreviewContext as n, WidgetsApiProvider as r, ErrorState as t };

//# sourceMappingURL=error-state-DSJb-3r5.mjs.map