PageSourceSearch

https://no-bad-words.art/assets/login-CIgpXdXb.js

js no-bad-words.art collected 2026-10-04 10:01:37 UTC 1,839 bytes, 1 lines download raw bytes

1import{u as b,a as f,b as j,R as o,r as n,j as e,L as N}from"./index-D7AFDH1b.js";import{P as y}from"./public_container-CgzlQqq1.js";import"./_commonjsHelpers-DaWZu8wl.js";const L="/dashboard";function R(){const l=b(),d=f(),m=j({select:s=>s.isLoading}),c=o.useNavigate(),[u,a]=n.useState(!1),[r,p]=n.useState(""),g=o.useSearch(),x=async s=>{a(!0);try{s.preventDefault();const t=new FormData(s.currentTarget);if(!t.has("email")||!t.has("password"))throw new Error("Email and password are required");const h=t.get("email").toString(),w=t.get("password").toString();await l.login(h,w),await d.invalidate(),await c({to:g.redirect||L})}catch(t){p(`${t}`)}finally{a(!1)}},i=m||u;return e.jsx(y,{children:e.jsxs("div",{className:"p-2 flex flex-col gap-2 place-items-center",children:[e.jsx("h3",{className:"text-xl",children:"Login"}),e.jsx("form",{className:"mt-4 max-w-lg",onSubmit:x,children:e.jsxs("fieldset",{disabled:i,className:"w-full grid gap-2",children:[e.jsx("label",{htmlFor:"email-input",className:"text-sm font-medium",children:"Email"}),e.jsx("input",{id:"email-input",name:"email",placeholder:"Enter your email",type:"email",className:"border rounded-md p-2 w-full",required:!0}),e.jsx("label",{htmlFor:"password-input",className:"text-sm font-medium",children:"Password"}),e.jsx("input",{id:"password-input",name:"password",placeholder:"Enter your password",type:"password",className:"border rounded-md p-2 w-full",required:!0}),e.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md w-full disabled:bg-gray-300 disabled:text-gray-500 cursor-pointer",children:i?"Logging In...":"Login"})]})}),r&&e.jsx("div",{className:"text-red-500 text-sm mt-2",children:r}),e.jsx("p",{children:e.jsx(N,{to:"/",className:"text-blue-500 hover:underline",children:"<< Back to Home"})})]})})}export{R as component};

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.