+
+
{currentUser?.apellido}, {currentUser?.nombre}
+
{currentUser?.rol}
+
@@ -106,6 +123,9 @@ export function Layout({ children, vistaActual, onCambiarVista }: LayoutProps) {
+
v2.0
@@ -132,11 +152,15 @@ export function Layout({ children, vistaActual, onCambiarVista }: LayoutProps) {
Menú
+
+
{currentUser?.apellido}, {currentUser?.nombre}
+
{currentUser?.rol}
+
-
+
: }
{theme === "dark" ? 'Modo Claro' : 'Modo Oscuro'}
+
@@ -159,4 +192,4 @@ export function Layout({ children, vistaActual, onCambiarVista }: LayoutProps) {
);
-}
+}
\ No newline at end of file
diff --git a/src/sections/Login.tsx b/src/sections/Login.tsx
new file mode 100644
index 0000000..5b57685
--- /dev/null
+++ b/src/sections/Login.tsx
@@ -0,0 +1,88 @@
+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);
+ } catch (err: any) {
+ setError(err.message || 'Error de autenticación');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+ Sistema de Gestión Hospitalaria
+ Ingrese sus credenciales para acceder
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/types/index.ts b/src/types/index.ts
index 34ee562..61cbf8c 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -204,4 +204,20 @@ export interface Indicacion {
fechaSuspension?: string;
}
-export type Vista = 'dashboard' | 'camas' | 'pacientes' | 'internaciones' | 'evoluciones' | 'laboratorios' | 'acidobase' | 'cultivos' | 'historiaclinica' | 'nuevoingreso' | 'editaringreso';
+export type Vista = 'dashboard' | 'camas' | 'pacientes' | 'internaciones' | 'evoluciones' | 'laboratorios' | 'acidobase' | 'cultivos' | 'historiaclinica' | 'nuevoingreso' | 'editaringreso' | 'usuarios';
+
+export type RolUsuario = 'admin' | 'medico' | 'enfermero';
+
+export interface Usuario {
+ id: string;
+ apellido: string;
+ nombre: string;
+ dni: string;
+ fechaNacimiento: string;
+ email: string;
+ rol: RolUsuario;
+ matriculaProfesional?: string;
+ passwordHash: string;
+ areaId?: string;
+ fechaCreacion: string;
+}