@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
9 lines (8 loc) • 1.33 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),p=require("../AIPromptContent.js"),C=require("./AIPromptViewRender.js"),I=require("../AIPromptContext.js"),i=require("@progress/kendo-react-layout"),P=require("./constants.js"),s=t=>t==null?void 0:t.map(e=>n.createElement(i.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&s(e.children||[]))),d=t=>{const{commands:e}=t,[r]=I.useAIPromptContext(),u=m=>{var a,c,l;const o=(c=(a=m.target)==null?void 0:a.props)==null?void 0:c.data;(l=o.children)!=null&&l.length||r.onCommandExecute&&r.onCommandExecute.call(null,o)};return n.createElement(C.AIPromptViewRender,{name:P.commandsViewDefaults.name},n.createElement(p.AIPromptContent,{streaming:r.streaming,onCancel:r.onCancel},n.createElement("div",{className:"k-prompt-view"},n.createElement(i.PanelBar,{onSelect:u,selected:""},s(e!=null?e:[])))))};exports.AIPromptCommandsView=d;