"use client" import type React from "react" import { useState } from "react" import { useRouter } from "next/navigation" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Alert, AlertDescription } from "@/components/ui/alert" import { useAuth } from "@/lib/auth-context" import { Building2, AlertCircle, Loader2 } from "lucide-react" export default function LoginPage() { const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [error, setError] = useState("") const [isLoading, setIsLoading] = useState(false) const { login } = useAuth() const router = useRouter() const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError("") setIsLoading(true) const success = await login(email, password) if (success) { router.push("/dashboard") } else { setError("Credenciales incorrectas. Por favor, intente nuevamente.") setIsLoading(false) } } return (
{/* Logo/Brand */}
Logo Belén S.A.

Belén S.A.

Gestor de Precios

Iniciar Sesión Ingrese sus credenciales institucionales para acceder.
setEmail(e.target.value)} required disabled={isLoading} autoComplete="email" />
setPassword(e.target.value)} required disabled={isLoading} autoComplete="current-password" />
{error && ( {error} )}
) }