UNPKG

@copilotkit/react-ui

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

56 lines (53 loc) 2.13 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/components/chat/Suggestion.tsx var Suggestion_exports = {}; __export(Suggestion_exports, { Suggestion: () => Suggestion }); module.exports = __toCommonJS(Suggestion_exports); var import_react_core = require("@copilotkit/react-core"); // src/components/chat/Icons.tsx var import_jsx_runtime = require("react/jsx-runtime"); var SmallSpinnerIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "copilotKitSpinner", style: { width: "13px", height: "13px" } }); // src/components/chat/Suggestion.tsx var import_jsx_runtime2 = require("react/jsx-runtime"); function Suggestion({ title, onClick, partial, className }) { if (!title) return null; const { isLoading } = (0, import_react_core.useCopilotChatInternal)(); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( "button", { disabled: partial || isLoading, onClick: (e) => { e.preventDefault(); onClick(); }, className: className || (partial ? "suggestion loading" : "suggestion"), "data-test-id": "suggestion", children: partial ? SmallSpinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: title }) } ); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Suggestion }); //# sourceMappingURL=Suggestion.js.map