Fix responsive layouts for Internaciones/Evoluciones tables and currentUser undefined error

This commit is contained in:
2026-08-09 18:29:39 +00:00
parent 3cb381acd3
commit 7675df4ba1
8 changed files with 257 additions and 206 deletions
+12
View File
@@ -1,5 +1,6 @@
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
import type { Usuario } from '@/types'
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
@@ -12,3 +13,14 @@ export function formatDateDDMMYYYY(dateString: string): string {
const [year, month, day] = parts;
return `${day}-${month}-${year}`;
}
export function getNombreProfesional(user?: Usuario | null): string {
if (!user) return 'Admin';
if (user.rol === 'admin') return 'Admin';
const apellido = user.apellido?.trim() || '';
const nombre = user.nombre?.trim() || '';
if (apellido && nombre) return `${apellido}, ${nombre}`;
if (apellido) return apellido;
if (nombre) return nombre;
return 'Admin';
}