import { ArrowDownIcon, ArrowUpIcon } from 'lucide-react' import { Progress } from '@/components/ui/Progress' import { formatHomeSummaryDeltaMagnitude, homeSummaryDeltaAriaLabel, homeSummaryDeltaPeriodLabel, resolveHomeSummaryDeltaDirection, shouldShowHomeSummaryDelta, } from '@/lib/campaignHomeSummaryDelta' import { formatElectionNumber } from '@/lib/electionFormat' import { cn } from '@/lib/utils' import type { CampaignHomeSummaryView } from '@/utilities/campaignDashboardData' import { formatGoalCoverageRatioLabel, goalCoverageProgressPercent, } from '@/utilities/municipality/goalCoverage' const HomeSummaryDelta = ({ delta }: { delta: number | null }) => { if (!shouldShowHomeSummaryDelta(delta)) return null const direction = resolveHomeSummaryDeltaDirection(delta) const magnitude = formatHomeSummaryDeltaMagnitude(delta) return ( {direction === 'up' ? : null} {direction === 'down' ? : null} {magnitude} ) } export const CampaignHomeSummary = ({ view }: { view: CampaignHomeSummaryView }) => (

Votos estimados

{formatElectionNumber(view.staffVoteTotalCentral)}

{shouldShowHomeSummaryDelta(view.homeSummaryDelta) ? (

{homeSummaryDeltaPeriodLabel}

) : null}
Cobertura por lideranças {formatGoalCoverageRatioLabel(view.goalCoverage)}
{view.goalCoverage.coverageRatio != null ? ( ) : null}
)