import {
  SmallSpinnerIcon
} from "./chunk-XWG3L6QC.mjs";

// src/components/chat/Suggestion.tsx
import { useCopilotChatInternal as useCopilotChat } from "@finalyst/react-core";
import { jsx } from "react/jsx-runtime";
function Suggestion({ title, onClick, partial, className }) {
  if (!title)
    return null;
  const { isLoading } = useCopilotChat();
  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-FTJYOEQB.mjs.map