UNPKG

@coko/client

Version:

Client side common code for coko apps

77 lines (76 loc) 2.2 kB
import e from "../common/Spin.js"; import t from "../common/Result.js"; import n from "../common/Button.js"; import "../common/index.js"; import "react"; import r from "styled-components"; import { jsx as i } from "react/jsx-runtime"; //#region src/ui/authentication/VerifyEmail.tsx var a = r.div``, o = (r) => { let { className: o, verifying: s = !1, successfullyVerified: c = !1, alreadyVerified: l = !1, expired: u = !1, resend: d, resending: f = !1, resent: p = !1, redirectToLogin: m, redirectDelay: h = 3e3 } = r, g = () => { setTimeout(() => { m(); }, h); }; return s ? /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { icon: /* @__PURE__ */ i(e, { size: 18, spinning: !0 }), title: "Verifying your email address..." }) }) : c ? (g(), /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { status: "success", subTitle: "Redirecting you to login...", title: "Email successfully verified!" }) })) : l ? (g(), /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { status: "success", subTitle: "Redirecting you to login...", title: "This email has already been verified!" }) })) : u && !(f || p) ? /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { extra: /* @__PURE__ */ i(n, { onClick: d, type: "primary", children: "Resend verification email" }), status: "error", subTitle: "Click the button below to get a new token", title: "Your verification token has expired!" }) }) : f ? /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { icon: /* @__PURE__ */ i(e, { size: 18, spinning: !0 }), title: "Sending verification email..." }) }) : p ? /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { status: "success", subTitle: "Check your email for further instructions", title: "New verification email has been sent!" }) }) : /* @__PURE__ */ i(a, { className: o, children: /* @__PURE__ */ i(t, { status: "error", subTitle: "Try reloading the page or contact us", title: "Something went wrong!" }) }); }; //#endregion export { o as default };