import{r as t,j as a}from"./vendor-react-wBh_31cN.js";import{j,u as v}from"./vendor-redux-CJZrIb6x.js";import{u as g,d as N}from"./vendor-router-D1GqFWiT.js";import{r as x,aq as y,G as C}from"./index-BKr2rJhV.js";import{C as E,a as b,b as k,c as S}from"./card-DISTA6Ay.js";import{H}from"./Hero-ILcN0sPk.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./theme-colors-BFneJNsI.js";const M=()=>{var m,d;const i=g(),o=j(),[u]=N(),e=u.get("key"),[s,f]=t.useState(),[r,h]=t.useState(!1),c=v(l=>l.loading.effects.auth.validateEmail),n=t.useCallback(async l=>{h(!0);const p=await o.auth.validateEmail({key:l});f(p)},[o.auth]);return t.useEffect(()=>{e||i(x.auth.login),e&&!r&&!c&&n(e)},[e,i,r,n,c]),c||!r?a.jsx(y,{}):a.jsxs("div",{className:"flex flex-col items-center mt-[50px]",children:[a.jsx(H,{}),a.jsx("span",{className:"mb-[60px] mt-[15px] text-lg text-quartz-primary",children:"Hopsworks"}),a.jsxs(E,{className:"w-[466px]",children:[a.jsx(b,{children:a.jsx(k,{children:"Email verification"})}),a.jsxs(S,{className:"flex flex-col",children:[s!=null&&s.error?a.jsx("div",{className:"mt-2",children:a.jsx("span",{className:"text-xs",children:(s==null?void 0:s.message)||"Failed to verify your email."})}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-semibold",children:"Done"}),a.jsx("div",{className:"mt-2",children:a.jsx("span",{className:"text-xs",children:((d=(m=s==null?void 0:s.data)==null?void 0:m.data)==null?void 0:d.successMessage)||"Your email has been verified. An administrator needs to activate your account before you can login."})})]}),a.jsx("div",{className:"flex justify-end mt-5",children:a.jsx(C,{variant:"secondary",onClick:()=>i(x.auth.login),children:"Login"})})]})]})]})};export{M as default};
