'use client';
import { jsx as s } from "react/jsx-runtime";
import { Button as f } from "@heroui/react";
import { ArrowPathIcon as h } from "@heroicons/react/24/outline";
import { withErrorBoundary as u } from "../../common/error-boundary.js";
const E = u(function({
  onResend: e,
  disabled: d = !1,
  remainingTime: r = 0,
  attempt: o = 0,
  maxAttempts: n = 3,
  className: c,
  size: a = "md",
  radius: i = "md"
}) {
  const t = r === 0 && o < n, l = n - o;
  return /* @__PURE__ */ s(
    f,
    {
      color: "primary",
      variant: "light",
      size: a,
      radius: i,
      onClick: e,
      disabled: d || !t,
      className: c,
      startContent: t ? /* @__PURE__ */ s(h, { className: "h-3 w-3" }) : void 0,
      children: r > 0 ? `Resend in ${r}s` : o >= n ? "Max attempts reached" : `Resend${o > 0 ? ` (${l} left)` : ""}`
    }
  );
});
export {
  E as ResendEmailButton
};
//# sourceMappingURL=resend-email-button.js.map
