PageSourceSearch

https://sportscroll.com/assets/login-BJjVTOv6.js

js sportscroll.com collected 2026-10-02 06:47:18 UTC 2,361 bytes, 1 lines download raw bytes

1import{a as c,c as w,j as s}from"./vendor-react-Dw2qv6jq.js";import{u as b,F as L,a as d,b as m,c as u,d as x,e as p,t as N,o as v,s as j}from"./form-BDC63DnN.js";import{G as C,x as F,C as S,y as I,z as E,D as P,j as k,I as h,B as T}from"./index-BMu9MsG3.js";import{ae as f,aD as A}from"./vendor-ui-DNVmduUd.js";import"./label-Dtzn2d--.js";const D=v({email:j().email("Please enter a valid email"),password:j().min(1,"Password is required")});function R(){const[n,o]=c.useState(!1),{login:g,user:r,isLoading:t}=C(),[,i]=w(),{toast:l}=F(),a=b({resolver:N(D),defaultValues:{email:"",password:""}});if(c.useEffect(()=>{!t&&r&&i("/admin")},[r,t,i]),t||r)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx(f,{className:"h-8 w-8 animate-spin text-primary"})});const y=async e=>{o(!0);try{await g(e.email,e.password),l({title:"Welcome back!",description:"You have successfully logged in."}),i("/admin")}catch{l({title:"Login failed",description:"Invalid email or password. Please try again.",variant:"destructive"})}finally{o(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(S,{className:"w-full max-w-md",children:[s.jsxs(I,{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(A,{className:"h-6 w-6 text-primary"})}),s.jsx(E,{className:"text-2xl font-bold",children:"Admin Login"}),s.jsx(P,{children:"Sign in to manage SportScroll content"})]}),s.jsx(k,{children:s.jsx(L,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(y),className:"space-y-4",children:[s.jsx(d,{control:a.control,name:"email",render:({field:e})=>s.jsxs(m,{children:[s.jsx(u,{children:"Email"}),s.jsx(x,{children:s.jsx(h,{type:"email",placeholder:"[email protected]",...e,"data-testid":"input-email"})}),s.jsx(p,{})]})}),s.jsx(d,{control:a.control,name:"password",render:({field:e})=>s.jsxs(m,{children:[s.jsx(u,{children:"Password"}),s.jsx(x,{children:s.jsx(h,{type:"password",placeholder:"Enter your password",...e,"data-testid":"input-password"})}),s.jsx(p,{})]})}),s.jsxs(T,{type:"submit",className:"w-full",disabled:n,"data-testid":"button-login",children:[n&&s.jsx(f,{className:"mr-2 h-4 w-4 animate-spin"}),"Sign In"]})]})})})]})})}export{R 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.