Spaces:
Configuration error
Configuration error
Download src/pages/login.jsx from CPISTO/TARSTHENEXT: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/CPISTO/TARSTHENEXT/resolve/main/src/pages/login.jsx
- Command line
-
hf download hf://spaces/CPISTO/TARSTHENEXT/src/pages/login.jsx
-
curl -L -o login.jsx https://huggingface.co/spaces/CPISTO/TARSTHENEXT/resolve/main/src/pages/login.jsx
1.25 kB
| import { useState } from 'react' | |
| import { useNavigate } from 'react-router-dom' | |
| import { loginUser } from '../utils/sessionManager' | |
| export default function Login() { | |
| const [username, setUsername] = useState('') | |
| const [password, setPassword] = useState('') | |
| const navigate = useNavigate() | |
| const handleLogin = () => { | |
| const success = loginUser(username, password) | |
| if (success) navigate('/dashboard') | |
| else alert('Usuário ou senha inválidos') | |
| } | |
| return ( | |
| <div className="flex flex-col items-center justify-center h-screen bg-gray-100"> | |
| <h1 className="text-3xl font-bold mb-4">TARS - Login</h1> | |
| <input className="mb-2 p-2 border rounded" placeholder="Usuário" onChange={e => setUsername(e.target.value)} /> | |
| <input className="mb-2 p-2 border rounded" type="password" placeholder="Senha" onChange={e => setPassword(e.target.value)} /> | |
| <button className="bg-blue-500 text-white px-4 py-2 rounded" onClick={handleLogin}>Entrar</button> | |
| {/* AQUI ENTRA O LINK PARA CADASTRO */} | |
| <p | |
| className="mt-4 text-sm text-blue-600 cursor-pointer" | |
| onClick={() => navigate('/register')} | |
| > | |
| Não tem conta? Cadastrar | |
| </p> | |
| </div> | |
| ) | |
| } | |