"use client";
import { jsxs as a, jsx as o } from "react/jsx-runtime";
import { Button as n } from "./button.js";
import { useCopyToClipboard as c } from "../../hooks/use-copy-to-clipboard.js";
import { cn as t } from "../../lib/utils.js";
import l from "../../node_modules/lucide-react/dist/esm/icons/check.js";
import m from "../../node_modules/lucide-react/dist/esm/icons/copy.js";
function y({ content: s, copyMessage: i }) {
  const { isCopied: e, handleCopy: r } = c({
    text: s,
    copyMessage: i
  });
  return /* @__PURE__ */ a(
    n,
    {
      variant: "ghost",
      size: "icon",
      className: "relative h-6 w-6",
      "aria-label": "Copy to clipboard",
      onClick: r,
      children: [
        /* @__PURE__ */ o("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ o(
          l,
          {
            className: t(
              "h-4 w-4 transition-transform ease-in-out",
              e ? "scale-100" : "scale-0"
            )
          }
        ) }),
        /* @__PURE__ */ o(
          m,
          {
            className: t(
              "h-4 w-4 transition-transform ease-in-out",
              e ? "scale-0" : "scale-100"
            )
          }
        )
      ]
    }
  );
}
export {
  y as CopyButton
};
