diff --git a/src/components/Equipo_Computo/Pregunta2.tsx b/src/components/Equipo_Computo/Pregunta2.tsx index 3fc5db4..9256903 100644 --- a/src/components/Equipo_Computo/Pregunta2.tsx +++ b/src/components/Equipo_Computo/Pregunta2.tsx @@ -38,9 +38,36 @@ function transformPlatform(raw: RawOsEntry[]): OsEntry[] { count: Number(item.total), // Convierte string a nĂºmero })); - rows.sort((a, b) => - b.os.localeCompare(a.os, undefined, { numeric: true, sensitivity: "base" }) - ); + const order = { + "Windows 11": 1, + "Windows 10": 2, + "Windows 7/8": 3, + "Windows XP/Vista": 4, + Linux: 5, + + "Mac OS (13 - Ventura, 14 - Sonoma)": 6, + "MAC OS (SEQUOIA)": 7, + "Mac OS X (Mojave, Catalina, 11 - Big Sur, 12 - Monterrey)": 8, + "Mac OS X (Snow Leopard, Lion, Mountain Lion, Mavericks)": 9, + "Mac OS X (Yosemite, El Capitan, Sierra, High Sierra)": 10, + + "Chrome OS": 11, + + "Linux (CentOS, Fedora, Ubuntu, Red Hat Enterprise, entre otros)": 12, + "UNIX (AIX, MAC OS SERVER, SOLARIS, ENTRE OTROS)": 13, + + "Windows Server 2022/2023": 14, + "Windows Server 2016/2019": 15, + "Windows Server 2008/2012": 16, + "Windows Server 2000/2003": 17, + } as const; + + rows.sort((a, b) => { + const orderA = (order as Record)[a.os] ?? 999; + const orderB = (order as Record)[b.os] ?? 999; + return orderA - orderB; + }); + const total = rows.reduce((acc, r) => acc + r.count, 0); rows.push({ diff --git a/src/components/Equipo_Computo/pregunta2.module.scss b/src/components/Equipo_Computo/pregunta2.module.scss index 13424f7..d0c5f62 100644 --- a/src/components/Equipo_Computo/pregunta2.module.scss +++ b/src/components/Equipo_Computo/pregunta2.module.scss @@ -110,6 +110,7 @@ } .data-row_P1 { + text-align: end; display: flex; align-items: center; justify-content: space-between; @@ -126,6 +127,7 @@ flex: 1; font-size: 15px; color: #333; + padding-right: 1rem; } .count-box_P1 {