mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
B143 — usa Map para rótulos de dobradinha no facet
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
c9fdc59ed2
commit
7563fe45c3
1 changed files with 2 additions and 1 deletions
|
|
@ -367,9 +367,10 @@ export default async function LeadershipsPage({ searchParams }: LeadershipsPageP
|
|||
.filter((option): option is LeadershipFilterOption => option !== null)
|
||||
.sort((left, right) => left.label.localeCompare(right.label, 'pt-BR'))
|
||||
|
||||
const stateDeputyById = new Map(stateDeputySummaries.map((summary) => [summary.id, summary]))
|
||||
const stateDeputyFilterOptions: LeadershipFilterOption[] = filterFacets.stateDeputyIDs
|
||||
.map((id) => {
|
||||
const summary = stateDeputySummaries.find((entry) => entry.id === id)
|
||||
const summary = stateDeputyById.get(id)
|
||||
if (!summary) return null
|
||||
const label = summary.party ? `${summary.name} (${summary.party})` : summary.name
|
||||
return { value: String(id), label }
|
||||
|
|
|
|||
Loading…
Reference in a new issue