(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6712],{6227:(e,s,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/email-verification",function(){return i(2751)}])},2751:(e,s,i)=>{"use strict";i.r(s),i.d(s,{__N_SSP:()=>r,default:()=>d});var n=i(4848),l=i(6540),a=i(1710),c=i(9020),t=i(8883),r=!0;function d(e){let{user:s,verified:i}=e,[r,d]=l.useState(!1),[o,m]=l.useState(null);return i?(l.useEffect(()=>{try{setTimeout(()=>{window.location.pathname="/admin"},2e3)}catch(e){(0,c.A)("/api/admin/clientError",{method:"post",body:{component:"email-verification/index-page-component/lines-72-74",message:e.message,user:s}}),window.location.pathname="/logout"}},[]),(0,n.jsx)(t.A,{head:(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)("title",{children:"Verify Email Address"}),(0,n.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:s,children:(0,n.jsx)("main",{className:"flex items-center justify-center w-full p-8",children:(0,n.jsx)("div",{className:"login-block gap-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("img",{src:"/images/checkmark.svg",alt:"check-mark",width:30}),(0,n.jsx)("span",{className:"text-xl",children:"Email Verification Successfull!"})]})})})})):(0,n.jsx)(l.Fragment,{children:(0,n.jsx)(t.A,{head:(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)("title",{children:"Verify Email Address"}),(0,n.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:s,children:(0,n.jsx)("main",{className:"flex flex-col items-center p-8 justify-center w-full",children:(0,n.jsxs)("div",{className:"login-block gap-2 flex-col max-w-lg",children:[o&&(0,n.jsx)("div",{className:o.class+" w-full rounded py-2 px-4 flex justify-center",children:o.msg}),r&&(0,n.jsx)(a.A,{position:"absolute"}),(0,n.jsx)("h1",{className:"text-2xl m-0 ",children:"Verify Email Address"}),(0,n.jsx)("span",{children:"Please click the button below to send verification link"}),(0,n.jsx)("button",{className:"w-full",onClick:function(e){e.preventDefault(),d(!0),(0,c.A)("/api/sendEmailVerificationLink").then(e=>{d(!1),e.success&&m({msg:"Email Sent. Please check mailbox",class:"bg-emerald-100"})})},children:(0,n.jsx)("span",{children:"Send Verification Link"})}),(0,n.jsx)("button",{className:"w-full outlined",onClick:e=>{window.history.back()},children:(0,n.jsx)("span",{children:"Go Back"})})]})})})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[636,6593,8792],()=>s(6227)),_N_E=e.O()}]);