'use client' import { useState } from 'react' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Mail, CheckCircle } from 'lucide-react' import { useAuth } from '@/lib/auth/context' export default function LoginPage() { const { signIn } = useAuth() const [email, setEmail] = useState('') const [loading, setLoading] = useState(false) const [emailSent, setEmailSent] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (!email) return setLoading(true) try { const { error } = await signIn(email) if (error) { alert('Error al enviar el enlace mágico: ' + error.message) } else { setEmailSent(true) } } catch (error) { console.error('Auth error:', error) alert('Error al enviar el enlace mágico') } finally { setLoading(false) } } return (
Accede a tu cuenta
Hemos enviado un enlace mágico a {email}
El enlace expirará en 1 hora. Revisa tu bandeja de entrada y carpeta de spam.
¿No necesitas cuenta? Reserva como invitado