import { useState } from 'react'; import { useHospitalStore } from '@/hooks/useHospitalStore'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Shield, Lock, User } from 'lucide-react'; export function Login() { const { login } = useHospitalStore(); const [dni, setDni] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setLoading(true); try { await login(dni, password); window.location.reload(); } catch (err) { setError(err instanceof Error ? err.message : 'Error de autenticación'); } finally { setLoading(false); } }; return (