import{l as m,h as u,p as d,j as e,B as x,k as h}from"./index-gtttHy4o.js";import{F as t,I as n}from"./index-BNqke5YW.js";import{R as p,a as g}from"./UserOutlined-BO28NBvO.js";const w=function(){const[o]=t.useForm(),a=m(),{t:s}=u(),r=d(),c=async i=>{try{await r.mutateAsync(i),a({to:"/"})}catch(l){console.error("login failed",l),h.error(s("account.usernameIncorrect"))}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-r from-blue-50 to-indigo-50 p-4",children:e.jsxs("div",{className:"max-w-md w-full space-y-8 bg-white p-10 rounded-xl shadow-lg",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("img",{src:"/logo.svg",alt:"logo",className:"w-8 h-8"}),e.jsx("span",{className:"text-3xl text-gray-800",children:"VisU"})]}),e.jsx("p",{className:"mt-2 text-gray-600",children:s("slogan")})]}),e.jsxs(t,{form:o,name:"login",layout:"vertical",initialValues:{remember:!0},onFinish:c,size:"large",className:"mt-8",children:[e.jsx(t.Item,{name:"username",rules:[{required:!0,message:s("account.usernamePlaceholder")}],children:e.jsx(n,{prefix:e.jsx(p,{className:"site-form-item-icon"}),placeholder:s("account.username")})}),e.jsx(t.Item,{name:"password",rules:[{required:!0,message:s("account.passwordPlaceholder")}],children:e.jsx(n.Password,{prefix:e.jsx(g,{className:"site-form-item-icon"}),placeholder:s("account.password")})}),e.jsx(t.Item,{children:e.jsx(x,{type:"primary",htmlType:"submit",className:"w-full",loading:r.isPending,children:s("account.login")})}),e.jsx("div",{className:"text-center",children:e.jsx("a",{onClick:()=>a({to:"/register"}),className:"text-blue-600 hover:text-blue-800 ml-1 cursor-pointer",children:s("account.register")})})]})]})})};export{w as component};
