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

47 lines (46 loc) 1.49 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 t from "react"; import { PromptHeader as S } from "./AIPromptHeader.mjs"; import { promptViewDefaults as h } from "./views/AIPromptView.mjs"; import { outputViewDefaults as P } from "./views/AIPromptOutputView.mjs"; import { AIPromptContext as x } from "./AIPromptContext.mjs"; import { classNames as A } from "@progress/kendo-react-common"; const D = (a) => { const { activeView: e, toolbarItems: m, children: c, onActiveViewChange: o, onPromptRequest: i, onCommandExecute: s, style: n, dir: l, className: p, ...u } = a, f = m || [h, P], [v, w] = t.useState({ activeView: e }), r = { ...v, activeView: e, onActiveViewChange: o, onPromptRequest: i, onCommandExecute: s }, d = (V) => { w(V); }; return /* @__PURE__ */ t.createElement(x.Provider, { value: [r, d] }, /* @__PURE__ */ t.createElement("div", { className: A("k-prompt", p), style: n, dir: l, ...u }, /* @__PURE__ */ t.createElement( S, { activeView: r.activeView, toolbarItems: f, activeViewChange: o } ), c)); }; export { D as AIPrompt };