1import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{t as r}from"./link-CVAmi_oH.js";import{P as i,n as a,p as o}from"./index-Dq0vGLik.js";var s=e(t()),c=n();function l(){let{user:e,login:t}=o(),n=a.useNavigate(),[l,u]=(0,s.useState)(``),[d,f]=(0,s.useState)(``),[p,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n({to:`/profile`})},[e,n]),(0,c.jsx)(`div`,{className:`grid min-h-[80vh] place-items-center bg-background p-4`,children:(0,c.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!l.trim()||!d){i.error(`Email and password are required`);return}m(!0);let r=await t(l,d);m(!1),r.error?i.error(r.error):(i.success(`Logged in successfully`),n({to:`/`}))},className:`w-full max-w-md rounded-3xl glass-card p-6 md:p-8`,children:[(0,c.jsx)(`h1`,{className:`text-2xl md:text-3xl font-extrabold text-foreground`,children:`Welcome back`}),(0,c.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Login to manage your orders and save your account details.`}),(0,c.jsx)(`label`,{className:`mt-5 md:mt-6 block text-sm font-semibold text-foreground`,children:`Email`}),(0,c.jsx)(`input`,{type:`email`,value:l,onChange:e=>u(e.target.value),placeholder:`[email protected]`,className:`mt-2 w-full rounded-xl border border-border bg-secondary px-4 py-3.5 text-sm outline-none focus:border-gold focus:bg-white`}),(0,c.jsx)(`label`,{className:`mt-4 block text-sm font-semibold text-foreground`,children:`Password`}),(0,c.jsx)(`input`,{type:`password`,value:d,onChange:e=>f(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,className:`mt-2 w-full rounded-xl border border-border bg-secondary px-4 py-3.5 text-sm outline-none focus:border-gold focus:bg-white`}),(0,c.jsx)(`button`,{disabled:p,className:`mt-5 md:mt-6 w-full rounded-xl bg-amber px-4 py-3.5 text-sm font-bold text-navy transition hover:brightness-110 disabled:opacity-50 min-h-[50px]`,children:p?`Logging in...`:`Login`}),(0,c.jsxs)(`p`,{className:`mt-4 text-center text-sm text-muted-foreground`,children:[`Don't have an account?`,` `,(0,c.jsx)(r,{to:`/signup`,className:`font-semibold text-foreground hover:text-gold`,children:`Sign up`})]})]})})}export{l as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.