@frank-auth/react
Version:
Flexible and customizable React UI components for Frank Authentication
37 lines (36 loc) • 988 B
JavaScript
'use client';
import { jsx as s } from "react/jsx-runtime";
import "@emotion/styled";
import { Button as f } from "../../../ui/button/button.js";
import { ArrowPathIcon as h } from "@heroicons/react/24/outline";
import { withErrorBoundary as m } from "../../common/error-boundary.js";
const $ = m(function({
onResend: e,
disabled: d = !1,
remainingTime: r = 0,
attempt: o = 0,
maxAttempts: n = 3,
className: c,
size: i = "md",
radius: a = "md"
}) {
const t = r === 0 && o < n, l = n - o;
return /* @__PURE__ */ s(
f,
{
color: "primary",
variant: "light",
size: i,
radius: a,
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 {
$ as ResendEmailButton
};
//# sourceMappingURL=resend-email-button.js.map