UNPKG

@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

29 lines (28 loc) 1.59 kB
/** * @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 u } from "./AIPromptViewRender.mjs"; import { moreHorizontalIcon as I } from "@progress/kendo-svg-icons"; import { useAIPromptContext as f } from "../AIPromptContext.mjs"; import { PanelBar as d, PanelBarItem as C } from "@progress/kendo-react-layout"; const E = { name: "Commands view", buttonIcon: I }, c = (t) => t == null ? void 0 : t.map((e) => /* @__PURE__ */ r.createElement(C, { title: e.text, key: e.id, svgIcon: e.svgIcon, data: e }, e.children && c(e.children || []))), A = (t) => { const { commands: e } = t, [n] = f(), i = (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(u, { name: E.name }, /* @__PURE__ */ r.createElement(s, null, /* @__PURE__ */ r.createElement("div", { className: "k-prompt-view" }, /* @__PURE__ */ r.createElement(d, { onSelect: i, selected: "" }, c(e != null ? e : []))))); }; export { A as AIPromptCommandsView, E as commandsViewDefaults };