@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
49 lines (48 loc) • 2.03 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 * as e from "react";
import { classNames as s } from "@progress/kendo-react-common";
import { FocusableUponSelection as i } from "./base/FocusableUponSelection.mjs";
class p extends i {
render() {
return /* @__PURE__ */ e.createElement(
"div",
{
className: this.getClassNames(),
tabIndex: this.getTabIndexValue(),
onClick: this.props.onClick,
ref: (t) => this.elementToFocus = t
},
this.props.template ? /* @__PURE__ */ e.createElement(this.props.template, { item: this.props.item }) : /* @__PURE__ */ e.createElement("div", { className: "k-card" }, /* @__PURE__ */ e.createElement("div", { className: "k-card-body" }, this.getTitleView(), this.getSubtitleView(), this.getContentView()))
);
}
getTabIndexValue() {
if (this.props.tabbable !== void 0)
return this.props.tabbable ? 0 : -1;
}
getClassNames() {
return s(
{ "k-selected": this.props.selected },
{ "k-focus": this.props.selected },
{ "k-first": this.props.isFirstItemInGroup },
{ "k-last": this.props.isLastItemInGroup }
);
}
getTitleView() {
return this.props.item.title ? /* @__PURE__ */ e.createElement("h5", { className: "k-card-title" }, this.props.item.title) : null;
}
getSubtitleView() {
return this.props.item.subtitle ? /* @__PURE__ */ e.createElement("h6", { className: "k-card-subtitle" }, this.props.item.subtitle) : null;
}
getContentView() {
return this.props.item.contentType.indexOf("image/") === 0 ? /* @__PURE__ */ e.createElement("img", { src: this.props.item.content }) : this.props.item.content;
}
}
export {
p as default
};