teqo/src/components/campaign/PlazaListOverview.tsx
Francisco Ignácio Fontoura Solla cf13c441aa Remodel /campanha around predefined Praças replacing electoral nuclei.
436 seeded Praças (municipality-based; per-TSE-zone in Salvador/Camaçari) become
the operational unit; roles renamed to coordinator/advisor/leader with advisors
scoped to administered Praças. Leadership is one record per person across many
Praças/organizations; vote pledges split leader-declared vs staff-estimated
(estimates never serialized to leaders). Adds organizations, demand workflow
with staff-only cost/receipts, action-plan results with deputy presence, manual
political trend, multi-candidate comparison and the diverging red/white/blue
map mode. Migration 20260721_020109_remodel_plazas deliberately resets the
campaign vertical in production (public site untouched); test suite ported to
the new model (unit 187 / int 306 / e2e 9 green).
2026-07-21 02:28:00 -03:00

40 lines
1.4 KiB
TypeScript

import { CampaignMetricStrip } from '@/components/campaign/CampaignMetricStrip'
import { campaignPrioritySurfaceClassName } from '@/components/campaign/CampaignPageShell'
import type { PlazaListOverviewData } from '@/utilities/plazaPageData'
const voteFormatter = new Intl.NumberFormat('pt-BR')
export const PlazaListOverview = ({ view }: { view: PlazaListOverviewData }) => (
<section
aria-label="Visão geral das Praças filtradas"
className={`rounded-xl ${campaignPrioritySurfaceClassName}`}
>
<CampaignMetricStrip
metrics={[
{
label: 'Votos estimados no conjunto',
value: view.pledgeCount ? voteFormatter.format(view.effectiveVotesTotal) : '—',
emphasize: true,
},
{
label: 'Declarações de votos',
value: view.pledgeCount
? `${voteFormatter.format(view.pledgeCount)}${
view.missingEstimateCount
? ` · ${voteFormatter.format(view.missingEstimateCount)} sem estimativa`
: ''
}`
: 'Nenhuma',
},
{
label: 'Cobertura de assessoria',
value: `${view.withAdvisorCount} de ${view.plazaCount} Praças`,
progress:
view.plazaCount > 0
? Math.round((view.withAdvisorCount / view.plazaCount) * 100)
: undefined,
},
]}
/>
</section>
)