"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const designSystem = require("@choiceform/design-system");
const iconsReact = require("@choiceform/icons-react");
const React = require("react");
const index = require("../../../../i18n/index.cjs");
const tv = require("./tv.cjs");
const promptInputContext = require("../../context/prompt-input-context.cjs");
const PromptSendButton = React.memo(function PromptSendButton2(props) {
  const { className, ...rest } = props;
  const { handleSendMessageClick, sendButtonState, hasUnuploadedAttachments, isStreaming } = promptInputContext.usePromptInputContext();
  const addQueue = index.t("prompt-input", "add-queue");
  const stop = index.t("prompt-input", "stop");
  const tv$1 = tv.promptSendButtonTv({ isStreaming });
  return /* @__PURE__ */ jsxRuntime.jsxs(
    designSystem.Button,
    {
      ...rest,
      onClick: handleSendMessageClick,
      className: designSystem.tcx(tv$1.button({ className })),
      disabled: sendButtonState.disabled,
      variant: sendButtonState.addQueue ? "secondary" : "primary",
      children: [
        hasUnuploadedAttachments ? /* @__PURE__ */ jsxRuntime.jsx(iconsReact.PromptToolbarWaiting, {}) : sendButtonState.addQueue ? /* @__PURE__ */ jsxRuntime.jsx(iconsReact.PromptToolbarAddQueue, {}) : sendButtonState.icon === "cancel" ? /* @__PURE__ */ jsxRuntime.jsx(iconsReact.PromptToolbarCancel, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsReact.PromptToolbarSubmit, {}),
        isStreaming && /* @__PURE__ */ jsxRuntime.jsx("span", { children: sendButtonState.addQueue ? addQueue : stop })
      ]
    }
  );
});
exports.PromptSendButton = PromptSendButton;
//# sourceMappingURL=prompt-send-button.cjs.map
