@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
35 lines (34 loc) • 1.31 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 s from "react";
import { classNames as c } from "@progress/kendo-react-common";
const p = (d) => {
const { suggestions: o, onSuggestionClick: l, suggestionsView: r } = d, t = (e, a) => {
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l(e, a));
}, i = () => o.map((e) => /* @__PURE__ */ s.createElement(
"span",
{
role: "button",
tabIndex: e.disabled ? -1 : 0,
"aria-label": e.description,
"aria-disabled": e.disabled,
onClick: (a) => !e.disabled && l(a, e),
onKeyDown: (a) => !e.disabled && t(a, e),
key: e.id,
title: e.description,
className: c(r === "classic" ? "k-prompt-suggestion" : "k-suggestion", {
"k-disabled": e.disabled
})
},
e.text
));
return r === "classic" ? i() : /* @__PURE__ */ s.createElement("div", { role: "group", className: "k-suggestion-group" }, i());
};
export {
p as SuggestionGroup
};