import{F as a,n as u,b as d,a1 as x,j as e,h as r,B as n,l as h}from"./index-BfgM_Nqd.js";import{R as g,a as p}from"./UserOutlined-o2bZ2Qro.js";const y=function(){const[c]=a.useForm(),o=u(),{t:s}=d(),t=x(),i=async l=>{try{await t.mutateAsync(l),o({to:"/"})}catch(m){console.error("login failed",m),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(a,{form:c,name:"login",layout:"vertical",initialValues:{remember:!0},onFinish:i,size:"large",className:"mt-8",children:[e.jsx(a.Item,{name:"username",rules:[{required:!0,message:s("account.usernamePlaceholder")}],children:e.jsx(r,{prefix:e.jsx(g,{className:"site-form-item-icon"}),placeholder:s("account.username")})}),e.jsx(a.Item,{name:"password",rules:[{required:!0,message:s("account.passwordPlaceholder")}],children:e.jsx(r.Password,{prefix:e.jsx(p,{className:"site-form-item-icon"}),placeholder:s("account.password")})}),e.jsx(a.Item,{children:e.jsx(n,{type:"primary",htmlType:"submit",className:"w-full",loading:t.isPending,children:s("account.login")})}),e.jsx(a.Item,{className:"text-center",children:e.jsx(n,{type:"link",className:"!px-0",size:"small",href:"/register",children:s("account.register")})})]})]})})};export{y as component};
