35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
let react = require("react");
|
|
react = require_runtime.__toESM(react);
|
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
let _lit_labs_react = require("@lit-labs/react");
|
|
|
|
//#region src/components/CopilotKitInspector.tsx
|
|
const CopilotKitInspector = ({ core, ...rest }) => {
|
|
const [InspectorComponent, setInspectorComponent] = react.useState(null);
|
|
react.useEffect(() => {
|
|
let mounted = true;
|
|
import("@copilotkitnext/web-inspector").then((mod) => {
|
|
mod.defineWebInspector?.();
|
|
const Component = (0, _lit_labs_react.createComponent)({
|
|
tagName: mod.WEB_INSPECTOR_TAG,
|
|
elementClass: mod.WebInspectorElement,
|
|
react
|
|
});
|
|
if (mounted) setInspectorComponent(() => Component);
|
|
});
|
|
return () => {
|
|
mounted = false;
|
|
};
|
|
}, []);
|
|
if (!InspectorComponent) return null;
|
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InspectorComponent, {
|
|
...rest,
|
|
core: core ?? null
|
|
});
|
|
};
|
|
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
|
|
//#endregion
|
|
exports.CopilotKitInspector = CopilotKitInspector;
|
|
//# sourceMappingURL=CopilotKitInspector.cjs.map
|