PageSourceSearch

https://swimcoachsg-netto.lovable.app/assets/AdminLogin-DLV9oP4N.js

js swimcoachsg-netto.lovable.app collected 2026-10-03 03:40:14 UTC 2,313 bytes, 6 lines download raw bytes

1import{j as e}from"./ui-BOMEkoMf.js";import{g as v,r as a}from"./vendor-CItzcg8z.js";import{f as w,u as b,w as y,B as N}from"./index-Cdph4NGr.js";import{I as m}from"./input-BXmHiix8.js";import{L as u}from"./label-Diw88NSH.js";import{C as S,a as C,b as L,c as I,d as k}from"./card-CvUVFQQi.js";import"./motion-BrtF-6T7.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const A=w("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);function z(){const i=v(),{toast:h}=b(),{signIn:x,isAdmin:n,isLoading:t,user:c}=y(),[d,p]=a.useState(""),[l,f]=a.useState(""),[o,r]=a.useState(!1);a.useEffect(()=>{!t&&c&&n&&i("/admin/dashboard")},[t,c,n,i]);const g=async s=>{s.preventDefault(),r(!0);const{error:j}=await x(d,l);if(j){h({title:"Login failed",description:"Invalid credentials",variant:"destructive"}),r(!1);return}setTimeout(()=>{r(!1)},1e3)};return t?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:e.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:e.jsxs(S,{className:"w-full max-w-md",children:[e.jsxs(C,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:e.jsx(A,{className:"h-6 w-6 text-primary"})}),e.jsx(L,{children:"Admin Access"}),e.jsx(I,{children:"Sign in to access the admin dashboard"})]}),e.jsx(k,{children:e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(m,{id:"email",type:"email",value:d,onChange:s=>p(s.target.value),placeholder:"[email protected]",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"password",children:"Password"}),e.jsx(m,{id:"password",type:"password",value:l,onChange:s=>f(s.target.value),placeholder:"••••••••",required:!0})]}),e.jsx(N,{type:"submit",className:"w-full",disabled:o,children:o?"Signing in...":"Sign In"})]})})]})})}export{z 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.