1import{r,a1 as m,u as h,a3 as f,j as e,B as p,a7 as x,a8 as g}from"./index-CRzFJT5-.js";import{I as w}from"./input-OMPQu2El.js";import{C as y,a as j,b,c as v}from"./card-C-j4uAIC.js";import{L as C}from"./lock-Zn1Pyf2F.js";function I(){const[i,c]=r.useState(""),[n,o]=r.useState(!1),[,a]=m(),{toast:l}=h(),{data:s}=f({queryKey:["/api/auth/check"]});r.useEffect(()=>{s!=null&&s.isAdmin&&a("/admin")},[s,a]);const u=async t=>{t.preventDefault(),o(!0);try{(await x("POST","/api/auth/login",{password:i})).ok&&(await g.invalidateQueries({queryKey:["/api/auth/check"]}),a("/admin"))}catch{l({title:"Inloggen mislukt",description:"Ongeldig wachtwoord. Probeer het opnieuw.",variant:"destructive"})}finally{o(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:e.jsxs(y,{className:"w-full max-w-sm",children:[e.jsxs(j,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-2 w-12 h-12 rounded-full bg-[#1a2533] flex items-center justify-center",children:e.jsx(C,{className:"w-6 h-6 text-white"})}),e.jsx(b,{children:"Admin Login"})]}),e.jsx(v,{children:e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsx(w,{type:"password",placeholder:"Wachtwoord",value:i,onChange:t=>c(t.target.value),required:!0,autoFocus:!0}),e.jsx(p,{type:"submit",className:"w-full",disabled:n,children:n?"Bezig...":"Inloggen"})]})})]})})}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.