1import{r as a,G as e}from"./vendor-common-BIEn9f1K.js";import{a5 as p}from"./db-_glEXzI2.js";import{e as g,aa as b,ar as h,aK as f}from"./vendor-icons-DDr7qLba.js";import"./firebase-Bovevv3C.js";import"./vendor-firebase-DFeYylCO.js";function k({onLoginSuccess:c}){const[t,m]=a.useState(""),[l,u]=a.useState(""),[i,n]=a.useState(null),[o,d]=a.useState(!1),x=async r=>{r.preventDefault(),d(!0),n(null);try{const s=await p(t,l);localStorage.setItem("autokuca_user",JSON.stringify(s)),c(s)}catch(s){console.error("Login error:",s),n(s.message||"GreÅ¡ka pri prijavi.")}finally{d(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 p-4",children:e.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-xl p-8 border border-gray-100",children:[e.jsxs("div",{className:"flex flex-col items-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-2xl flex items-center justify-center mb-4",children:e.jsx(g,{className:"w-10 h-10 text-red-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Auto KuÄa FR&JO"}),e.jsx("p",{className:"text-gray-500 text-center mt-2",children:"Prijavite se na svoj nalog za pristup administraciji"})]}),i&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 border border-red-100 text-red-600 rounded-xl text-sm",children:i}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"KorisniÄko ime"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx("input",{type:"text",required:!0,value:t,onChange:r=>m(r.target.value),className:"w-full pl-10 pr-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent outline-none transition-all",placeholder:"unesite korisniÄko ime"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Lozinka"}),e.jsxs("div",{className:"relative",children:[e.jsx(h,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx("input",{type:"password",required:!0,value:l,onChange:r=>u(r.target.value),className:"w-full pl-10 pr-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent outline-none transition-all",placeholder:"unesite lozinku"})]})]}),e.jsx("button",{type:"submit",disabled:o,className:"w-full flex items-center justify-center gap-3 bg-red-600 hover:bg-red-700 text-white font-semibold py-4 px-6 rounded-xl transition-all duration-200 disabled:opacity-50 shadow-lg shadow-red-200",children:o?e.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"w-5 h-5"}),"Prijavi se"]})})]}),e.jsx("div",{className:"mt-8 pt-6 border-t border-gray-100 text-center",children:e.jsx("p",{className:"text-xs text-gray-400",children:"Pristup je dozvoljen samo autorizovanim radnicima i administratorima."})})]})})}export{k 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.