From 84ba9da19ec791c697293b0d8e29a29d88f6a24b Mon Sep 17 00:00:00 2001 From: Guillermo Martinez <134286903+GuillePrograma94@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:46:26 +0000 Subject: [PATCH] Update page.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ordenamos los valores de los pueblos para que estén organizados alfabéticamente en el desplegable. --- src/app/casos-activos/solicitudes/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/casos-activos/solicitudes/page.tsx b/src/app/casos-activos/solicitudes/page.tsx index 9981f6d..1983f1e 100644 --- a/src/app/casos-activos/solicitudes/page.tsx +++ b/src/app/casos-activos/solicitudes/page.tsx @@ -146,6 +146,8 @@ function Solicitudes() { ); } + const sortedTowns = towns.slice().sort((a, b) => (a.name ?? "").localeCompare(b.name ?? "")); // Organizamos de A-Z los nombres de los pueblos obtenidos. + return ( <> {/* FILTROS */} @@ -183,7 +185,7 @@ function Solicitudes() { className="px-4 py-2 rounded-lg w-full border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white text-gray-900 shadow-sm" > - {towns.map((item) => ( + {sortedTowns.map((item) => (