"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const iconsReact = require("@choiceform/icons-react");
const react = require("../../../_vendor/@legendapp/state/react.cjs");
const index = require("../../../_vendor/usehooks-ts/dist-index.cjs");
const tv = require("./tv.cjs");
const index$1 = require("../../../i18n/index.cjs");
const streamingStore = require("../../../stores/streaming-store.cjs");
const proxy = require("../../../_vendor/framer-motion/dist-es-render-components-motion-proxy.cjs");
const ScrollToBottomButton = react.observer(function ScrollToBottomButton2(props) {
  const { className, shouldShow, scrollToBottom } = props;
  const isStreaming = react.use$(streamingStore.streamingStore$.isStreaming);
  const handleClick = index.useEventCallback(() => {
    scrollToBottom();
  });
  if (!shouldShow) {
    return null;
  }
  const scrollToBottomText = index$1.t("conversation", "scroll-to-bottom");
  const tv$1 = tv.ScrollToBottomTv({
    isStreaming
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    proxy.motion.div,
    {
      className: tv$1.root({ className }),
      initial: { opacity: 0, x: 10, y: isStreaming ? -32 : 0 },
      animate: { opacity: 1, x: 0, y: isStreaming ? -32 : 0 },
      exit: { opacity: 0, x: 10, y: isStreaming ? -32 : 0 },
      transition: { type: "spring", stiffness: 120, damping: 12, mass: 0.8 },
      children: /* @__PURE__ */ jsxRuntime.jsx(
        "button",
        {
          onClick: handleClick,
          className: tv$1.button(),
          "aria-label": scrollToBottomText,
          children: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.ArrowDown, { className: tv$1.icon() })
        }
      )
    }
  );
});
exports.ScrollToBottomButton = ScrollToBottomButton;
//# sourceMappingURL=scroll-to-bottom-button.cjs.map
