import { jsxs, jsx } from "react/jsx-runtime";
import { Button, tcx } from "@choiceform/design-system";
import { PromptToolbarWaiting, PromptToolbarAddQueue, PromptToolbarCancel, PromptToolbarSubmit } from "@choiceform/icons-react";
import { memo } from "react";
import { t } from "../../../../i18n/index.js";
import { promptSendButtonTv } from "./tv.js";
import { usePromptInputContext } from "../../context/prompt-input-context.js";
const PromptSendButton = memo(function PromptSendButton2(props) {
  const { className, ...rest } = props;
  const { handleSendMessageClick, sendButtonState, hasUnuploadedAttachments, isStreaming } = usePromptInputContext();
  const addQueue = t("prompt-input", "add-queue");
  const stop = t("prompt-input", "stop");
  const tv = promptSendButtonTv({ isStreaming });
  return /* @__PURE__ */ jsxs(
    Button,
    {
      ...rest,
      onClick: handleSendMessageClick,
      className: tcx(tv.button({ className })),
      disabled: sendButtonState.disabled,
      variant: sendButtonState.addQueue ? "secondary" : "primary",
      children: [
        hasUnuploadedAttachments ? /* @__PURE__ */ jsx(PromptToolbarWaiting, {}) : sendButtonState.addQueue ? /* @__PURE__ */ jsx(PromptToolbarAddQueue, {}) : sendButtonState.icon === "cancel" ? /* @__PURE__ */ jsx(PromptToolbarCancel, {}) : /* @__PURE__ */ jsx(PromptToolbarSubmit, {}),
        isStreaming && /* @__PURE__ */ jsx("span", { children: sendButtonState.addQueue ? addQueue : stop })
      ]
    }
  );
});
export {
  PromptSendButton
};
//# sourceMappingURL=prompt-send-button.js.map
