PageSourceSearch

https://grandehotelblog.lovable.app/assets/AdminLogin-Bli7Z99y.js

js grandehotelblog.lovable.app collected 2026-10-03 03:27:42 UTC 3,585 bytes, 1 lines download raw bytes

1import{r,s as j,t as N,j as e,v as f}from"./index-BhlmJFob.js";import{l as y}from"./logo-cms-Dn4GqFF5.js";import{L as E}from"./loader-circle-SHOl8wVE.js";import{A as C}from"./arrow-left-pqSTmJjU.js";const V=()=>{const[n,h]=r.useState(""),[i,b]=r.useState(""),[m,a]=r.useState(""),[u,l]=r.useState(""),[g,c]=r.useState(!1),[t,v]=r.useState("login");r.useEffect(()=>{const s=document.createElement("meta");return s.name="robots",s.content="noindex, nofollow",document.head.appendChild(s),()=>{document.head.removeChild(s)}},[]);const{login:x}=j(),p=N(),d=s=>{v(s),a(""),l("")},w=async s=>{if(s.preventDefault(),a(""),l(""),c(!0),t==="forgot"){const{error:o}=await f.auth.resetPasswordForEmail(n,{redirectTo:`${window.location.origin}/admin/reset-password`});o?a(o.message):l("E-mail de recuperação enviado! Verifique sua caixa de entrada."),c(!1);return}if(t==="signup"){const{error:o}=await f.auth.signUp({email:n,password:i});o?a(o.message):await x(n,i)?p("/admin"):(a("Conta criada. Faça login."),d("login"))}else await x(n,i)?p("/admin"):a("E-mail ou senha incorretos.");c(!1)};return e.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center gap-2 mb-4",children:e.jsx("img",{src:y,alt:"CMS",className:"h-20 w-auto"})}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t==="forgot"?"Recupere sua senha":"Acesse o painel de gestão do blog"})]}),e.jsxs("form",{onSubmit:w,className:"bg-card rounded-2xl shadow-lg p-8 border border-border",children:[m&&e.jsx("div",{className:"mb-4 p-3 bg-destructive/10 text-destructive rounded-lg text-sm",children:m}),u&&e.jsx("div",{className:"mb-4 p-3 bg-green-100 text-green-800 rounded-lg text-sm",children:u}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5",children:"E-mail"}),e.jsx("input",{type:"email",value:n,onChange:s=>h(s.target.value),placeholder:"[email protected]",required:!0,className:"w-full h-11 px-4 rounded-lg border border-input bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),t!=="forgot"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5",children:"Senha"}),e.jsx("input",{type:"password",value:i,onChange:s=>b(s.target.value),placeholder:"••••••••",required:!0,minLength:6,className:"w-full h-11 px-4 rounded-lg border border-input bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]})]}),e.jsxs("button",{type:"submit",disabled:g,className:"w-full h-11 mt-6 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[g&&e.jsx(E,{className:"w-4 h-4 animate-spin"}),t==="signup"?"Criar Conta":t==="forgot"?"Enviar E-mail de Recuperação":"Entrar"]}),e.jsxs("div",{className:"text-center text-sm text-muted-foreground mt-4 space-y-2",children:[t==="login"&&e.jsx("button",{type:"button",onClick:()=>d("forgot"),className:"text-primary hover:text-primary/80 transition-colors block mx-auto",children:"Esqueceu a senha?"}),t==="forgot"&&e.jsxs("button",{type:"button",onClick:()=>d("login"),className:"text-primary hover:text-primary/80 transition-colors inline-flex items-center gap-1",children:[e.jsx(C,{className:"w-3.5 h-3.5"})," Voltar ao login"]})]})]})]})})};export{V 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.