@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.69 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
*-------------------------------------------------------------------------------------------
*/
;const f=require("react"),g=require("@progress/kendo-react-common");function k(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const a=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(e,c,a.get?a:{enumerable:!0,get:()=>n[c]})}}return e.default=n,Object.freeze(e)}const t=k(f),p=n=>{const{item:e,template:c,tabbable:a,onClick:r,selected:l}=n,s=t.useRef(null);t.useEffect(()=>{l&&s.current&&s.current.focus()},[l]);const o=t.useCallback(()=>{if(a!==void 0)return a?0:-1},[a]),i=t.useCallback(()=>g.classNames({"k-selected":l},{"k-focus":l}),[l]),u=t.useCallback(()=>e.title?t.createElement("h5",{className:"k-card-title"},e.title):null,[e.title]),m=t.useCallback(()=>e.subtitle?t.createElement("h6",{className:"k-card-subtitle"},e.subtitle):null,[e.subtitle]),d=t.useCallback(()=>e.contentType.indexOf("image/")===0?t.createElement("img",{src:e.content,alt:e.title||"Attachment",style:{maxHeight:"200px",height:"auto",maxWidth:"200px",width:"auto"}}):e.content,[e.contentType,e.content,e.title]),b=c;return t.createElement("div",{className:i(),tabIndex:o(),onClick:r,ref:s},c?t.createElement(b,{item:e}):t.createElement("div",{className:"k-card"},t.createElement("div",{className:"k-card-body"},u(),m(),d())))};module.exports=p;