import { useState } from 'react'
import { authRepository } from '../repositories/authRepository.js'
import { BrandLogo } from '../components/Brand.jsx'
import { FeatureBadge, FeatureCallout } from '../components/FeatureState.jsx'
import loginClinicImage from '../assets/figma/login-clinic.png'
const mockCredentials = [
{ label: 'Admin', email: 'hugo@popcode.com.br', password: 'hdoria' },
{ label: 'Médico', email: 'leticia.lacerda@souunit.com.br', password: 'Senha@123' },
{ label: 'Secretária', email: 'recepcao@mediconnect.com', password: 'demo12345' },
{ label: 'Gestor', email: 'gestao@mediconnect.com', password: '12345678' },
]
export function LoginPage({ navigate }) {
const [form, setForm] = useState({
email: '',
password: '',
})
const [showPassword, setShowPassword] = useState(false)
const [credentialsOpen, setCredentialsOpen] = useState(false)
const [loading, setLoading] = useState(false)
const [error, setError] = useState('')
function updateField(field, value) {
setForm((current) => ({ ...current, [field]: value }))
}
async function handleSubmit(event) {
event.preventDefault()
setLoading(true)
setError('')
try {
await authRepository.login(form)
navigate('/inicio')
} catch (err) {
setError(err.message || 'Erro de autenticação')
} finally {
setLoading(false)
}
}
return (
Gestão clínica
inteligente com IA
preditiva.
Reduza o absenteísmo, organize sua agenda e melhore a experiência dos seus pacientes.
Entrar
Bem-vindo(a) de volta! Acesse sua conta.
{error && (
{error}
)}
{credentialsOpen ? (
Credenciais mockadas
{mockCredentials.map((credential) => (
))}
) : null}
)
}
export function RegisterPage({ navigate }) {
const [role, setRole] = useState('Clínica')
return (
)
}
export function ForgotPasswordPage({ navigate }) {
const [sent, setSent] = useState(false)
const [email, setEmail] = useState('recepcao@mediconnect.com')
const [error, setError] = useState('')
const [loading, setLoading] = useState(false)
async function handleSubmit(event) {
event.preventDefault()
setLoading(true)
setError('')
try {
await authRepository.requestPasswordReset(email)
setSent(true)
} catch (err) {
setError(err.message || 'Erro ao comunicar com o servidor.')
} finally {
setLoading(false)
}
}
return (
{sent ? (
Link de recuperação enviado para o e-mail informado. Siga as instruções do link!
) : (
)}
)
}
function AuthLayout({ children, description, title }) {
return (
Cuidado conectado
para equipes de
saúde.
Fluxos de acesso simulados para manter a navegação ponta a ponta sem backend real.
{title}
{description}
{children}
)
}
const authInputClass =
'h-11 w-full rounded-[6px] border border-white/10 bg-white/[0.05] px-4 text-sm text-white outline-none transition placeholder:text-white/30 focus:border-[#3b82f6] focus:ring-2 focus:ring-[#3b82f6]/20'
function AuthField({ children, label }) {
return (
)
}
function LoginField({ action, children, htmlFor, label }) {
return (
{action}
{children}
)
}
function LoginLogo() {
return (
)
}
function LoginMetric({ label, value }) {
return (
{value}
{label}
)
}
function EyeIcon() {
return (
)
}