'use client' import { CircleAlertIcon } from 'lucide-react' import { useEffect, useRef, useState } from 'react' import { CampaignTransitionAnchor } from '@/components/campaign/CampaignListPending' import { CampaignMetricStrip } from '@/components/campaign/CampaignMetricStrip' import { campaignPrioritySurfaceClassName } from '@/components/campaign/CampaignPageShell' import { useMunicipalityEstimateScenario } from '@/components/campaign/MunicipalityEstimateScenarioContext' import { VOTE_ESTIMATE_SCENARIO_OVERVIEW_HINT, VoteEstimateScenarioField, } from '@/components/campaign/VoteEstimateScenarioField' import { VoteEstimateScenarioStrip } from '@/components/campaign/VoteEstimateScenarioStrip' import { formatElectionNumber } from '@/lib/electionInsights' import { cn } from '@/lib/utils' import { formatGoalCoverageDeficitLabel, formatGoalCoverageRatioLabel, goalCoverageProgressPercent, } from '@/utilities/goalCoverage' import type { MunicipalityListOverviewData } from '@/utilities/municipalityPageData' import { formatVoteEstimateEndpointsLabel, hasAnyVoteEstimate, voteEstimateScenarioLabels, } from '@/utilities/voteEstimate' const SCENARIO_FLASH_MS = 420 /** * E9 "coluna da vergonha": the assessoria ratio hides the only gap the * coordination can close today, so the priority municipalities with nobody * answering for them are named as their own number — and the number is the * link that filters the list down to exactly those rows (`shameHref` is * `null` when that filter is already applied, so the count doesn't pretend to * navigate somewhere new). */ const AssessoriaGapDetail = ({ priorityWithoutAdvisorCount, shameHref, }: { priorityWithoutAdvisorCount: number shameHref: string | null }) => { if (priorityWithoutAdvisorCount === 0) { return
Nenhuma prioritária sem responsável
} const label = `${formatElectionNumber(priorityWithoutAdvisorCount)} ${ priorityWithoutAdvisorCount === 1 ? 'prioritária' : 'prioritárias' } sem responsável` if (!shameHref) { return{label}
} return ({endpointsLabel}
) : null} {view.missingEstimateCount > 0 ? ({formatElectionNumber(view.missingEstimateCount)}{' '} {view.missingEstimateCount === 1 ? 'declaração' : 'declarações'} sem estimativa
) : null}