Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
Ordenamos los valores de los pueblos para que estén organizados alfabéticamente en el desplegable.
  • Loading branch information
GuillePrograma94 authored Nov 10, 2024
1 parent 2aeea56 commit 84ba9da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/casos-activos/solicitudes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 */}
Expand Down Expand Up @@ -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"
>
<option value="todos">Todos los pueblos</option>
{towns.map((item) => (
{sortedTowns.map((item) => (
<option key={item.id} value={item.id}>
{item.name}
</option>
Expand Down

0 comments on commit 84ba9da

Please sign in to comment.