@progress/kendo-react-conversational-ui
Version:
React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components
25 lines (24 loc) • 1.55 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import r from "react";
import { AIPromptContent as s } from "../AIPromptContent.mjs";
import { AIPromptViewRender as f } from "./AIPromptViewRender.mjs";
import { useAIPromptContext as u } from "../AIPromptContext.mjs";
import { PanelBar as C, PanelBarItem as I } from "@progress/kendo-react-layout";
import { commandsViewDefaults as d } from "./constants.mjs";
const i = (t) => t == null ? void 0 : t.map((e) => /* @__PURE__ */ r.createElement(I, { title: e.text, key: e.id, svgIcon: e.svgIcon, data: e }, e.children && i(e.children || []))), w = (t) => {
const { commands: e } = t, [n] = u(), c = (p) => {
var l, a, m;
const o = (a = (l = p.target) == null ? void 0 : l.props) == null ? void 0 : a.data;
(m = o.children) != null && m.length || n.onCommandExecute && n.onCommandExecute.call(null, o);
};
return /* @__PURE__ */ r.createElement(f, { name: d.name }, /* @__PURE__ */ r.createElement(s, { streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ r.createElement("div", { className: "k-prompt-view" }, /* @__PURE__ */ r.createElement(C, { onSelect: c, selected: "" }, i(e != null ? e : [])))));
};
export {
w as AIPromptCommandsView
};