1import{r as a,ad as f,a5 as c,j as e,a as g}from"./index-CGQfa9u6.js";import{B as j}from"./button-D1DS7-1L.js";import{I as u}from"./input-D1cz3XuK.js";import{C as v,a as w,b as C,c as N}from"./card-lfLETgif.js";function I(){const[r,p]=a.useState(""),[n,x]=a.useState(""),[i,l]=a.useState(null),[o,d]=a.useState(!1),t=f();a.useEffect(()=>{c.auth.getUser().then(({data:s})=>{s.user&&t("/admin/selah",{replace:!0})})},[t]);const h=async s=>{s.preventDefault(),l(null),d(!0);const{error:m}=await c.auth.signInWithPassword({email:r,password:n});if(d(!1),m){l(m.message);return}t("/admin/selah",{replace:!0})};return e.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:[e.jsx(g,{title:"Admin sign in",description:"Internal admin"}),e.jsxs(v,{className:"w-full max-w-md",children:[e.jsx(w,{children:e.jsx(C,{children:"Admin sign in"})}),e.jsx(N,{children:e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Email"}),e.jsx(u,{type:"email",value:r,onChange:s=>p(s.target.value),required:!0,autoComplete:"email"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Password"}),e.jsx(u,{type:"password",value:n,onChange:s=>x(s.target.value),required:!0,autoComplete:"current-password"})]}),i&&e.jsx("p",{className:"text-sm text-destructive",children:i}),e.jsx(j,{type:"submit",className:"w-full",disabled:o,children:o?"Signing inâ¦":"Sign in"})]})})]})]})}export{I as default};
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.