import { jsxs as a, jsx as t } from "react/jsx-runtime";
import { ChevronDown as s } from "lucide-react";
import { Button as m } from "./button.js";
import { Tooltip as c, TooltipTrigger as p, TooltipContent as u } from "./tooltip.js";
import { cn as d } from "../../../lib/utils.js";
import { u as f } from "../../../StickToBottom-BGUuEI8O.js";
function C({
  className: r,
  variant: l = "outline",
  size: n = "sm",
  ...e
}) {
  const { isAtBottom: o, scrollToBottom: i } = f();
  return /* @__PURE__ */ a(c, { children: [
    /* @__PURE__ */ t(
      p,
      {
        render: /* @__PURE__ */ t(
          m,
          {
            "aria-hidden": o,
            "aria-label": "Scroll to bottom",
            className: d(
              "h-10 w-10 rounded-full transition-all duration-150 ease-out",
              o ? "pointer-events-none translate-y-4 scale-95 opacity-0" : "translate-y-0 scale-100 opacity-100",
              r
            ),
            "data-slot": "scroll-button",
            onClick: () => i(),
            size: n,
            tabIndex: o ? -1 : 0,
            variant: l,
            ...e
          }
        ),
        children: /* @__PURE__ */ t(s, { className: "h-5 w-5" })
      }
    ),
    !o && /* @__PURE__ */ t(u, { children: "Scroll to bottom" })
  ] });
}
export {
  C as ScrollButton
};
