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;" />

30 lines (28 loc) 806 B
import { SmallSpinnerIcon } from "./chunk-XWG3L6QC.mjs"; // src/components/chat/Suggestion.tsx import { useCopilotChatInternal } from "@copilotkit/react-core"; import { jsx } from "react/jsx-runtime"; function Suggestion({ title, onClick, partial, className }) { if (!title) return null; const { isLoading } = useCopilotChatInternal(); return /* @__PURE__ */ jsx( "button", { disabled: partial || isLoading, onClick: (e) => { e.preventDefault(); onClick(); }, className: className || (partial ? "suggestion loading" : "suggestion"), "data-test-id": "suggestion", children: partial ? SmallSpinnerIcon : /* @__PURE__ */ jsx("span", { children: title }) } ); } export { Suggestion }; //# sourceMappingURL=chunk-NGJ32FAP.mjs.map