import{r,Z as p,t as u,j as e,N as m}from"./index-B-YXshIJ.js";const h=()=>{const[s,l]=r.useState(""),[t,i]=r.useState(""),o=p("auth"),n=u.auth.verifySession.useQuery().data,d=r.useCallback(async a=>{a.preventDefault();try{(await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s,password:t})})).status===200&&window.location.replace("/?auth=true")}catch(c){}},[s,t]);return o&&n&&window.location.replace("/?auth=true"),e.jsx("div",{className:"px-6 pt-5 h-screen flex items-center justify-center",style:{background:"linear-gradient(180deg, #F6F2F9 50%, #FFFFFF 50%)"},children:e.jsxs("div",{className:"flex bg-white p-3 gap-2 rounded-md shadow-md",children:[e.jsxs("div",{className:"bg-purple-900 rounded-md w-[50%] p-6",children:[e.jsx("h4",{className:"text-white text-2xl font-bold pb-2",children:"Features"}),e.jsxs("ul",{className:"list-disc list-outside text-white text-base font-normal p-6",children:[e.jsx("li",{className:"p-3",children:"Feature 1 Lorem ipsum dolor sit amet consectetur adipisicing elit"}),e.jsx("li",{className:"p-3",children:"Feature 2 Lorem ipsum dolor sit amet consectetur adipisicing elit"}),e.jsx("li",{className:"p-3",children:"Feature 3 Lorem ipsum dolor sit amet consectetur adipisicing elit"}),e.jsx("li",{className:"p-3",children:"Feature 4 Lorem ipsum dolor sit amet consectetur adipisicing elit"})]})]}),e.jsxs("div",{className:" w-[50%] p-6",children:[e.jsx("h3",{className:"text-left text-gray-800 text-2xl font-semibold pb-1",children:"Login into your account"}),e.jsxs("p",{className:"pb-5",children:[e.jsxs("span",{className:"text-gray-600 text-base font-normal",children:["Don't have an account?"," "]}),e.jsx("a",{href:"/demo/register?auth=true",className:"text-purple-900 text-base font-semibold",children:"Register"})]}),e.jsxs("form",{onSubmit:d,children:[e.jsxs("div",{className:"pb-6 flex flex-col align-center justify-between",children:[e.jsx("label",{className:"pr-2 pb-2 text-gray-900 text-base font-semibold",htmlFor:"email",children:"Email"}),e.jsx("input",{className:"border border-gray-300 rounded-md px-3 py-3 placeholder-gray-400",id:"email",type:"email",value:s||"",onChange:a=>l(a.target.value),placeholder:"example@email.com",required:!0})]}),e.jsxs("div",{className:"pb-6 flex flex-col align-center justify-between",children:[e.jsx("label",{className:"pr-2 pb-2 text-gray-900 text-base font-semibold",htmlFor:"password",children:"Password"}),e.jsx("input",{className:"border border-gray-300 rounded-md px-3 py-3 placeholder-gray-400",id:"password",type:"password",value:t||"",onChange:a=>i(a.target.value),placeholder:"********",required:!0})]}),e.jsx("button",{type:"submit",className:m(s===""&&t===""?"bg-slate-300 px-5 py-3 text-stone-700 cursor-not-allowed":"bg-gradient-to-r from-purple-950 to-purple-800 text-white cursor-pointer","px-5 py-3 rounded-md w-full text-base font-semibold"),disabled:s===""&&t==="",children:"Login"})]})]})]})})};export{h as default};
