1import{u as g,q as b,r as s,j as e,s as h}from"./index-DdIJM-_l.js";function y(){const m=g(),{error:u}=b.useSearch(),[a,c]=s.useState(""),[n,x]=s.useState(""),[i,o]=s.useState(!1),[d,l]=s.useState(u==="not-admin"?"This account is not an admin.":null),p=async t=>{t.preventDefault(),l(null),o(!0);try{const{error:r}=await h.auth.signInWithPassword({email:a,password:n});if(r)throw r;m.navigate({to:"/admin/posts"})}catch(r){l(r instanceof Error?r.message:"Sign in failed")}finally{o(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:e.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-card p-8",children:[e.jsx("h1",{className:"font-display text-2xl text-primary",children:"Admin Sign in"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Sign in to manage blog posts."}),e.jsxs("form",{onSubmit:p,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:"Email"}),e.jsx("input",{type:"email",required:!0,value:a,onChange:t=>c(t.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-primary"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:"Password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:n,onChange:t=>x(t.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-primary"})]}),d&&e.jsx("p",{className:"text-sm text-destructive",children:d}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground disabled:opacity-50",children:i?"Please waitâ¦":"Sign in"})]})]})})}export{y 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.