import { Badge } from '@/components/ui/Badge' import { municipalityUpdatePolarityBadgeVariant, municipalityUpdatePolarityLabels, } from '@/lib/schemas/municipalityUpdate' import type { MunicipalityUpdateViewModel } from '@/utilities/municipality/municipalityUpdatePageData' const dateTimeFormatter = new Intl.DateTimeFormat('pt-BR', { dateStyle: 'short', timeStyle: 'short', }) const numberFormatter = new Intl.NumberFormat('pt-BR') export const MunicipalityUpdateFeed = ({ updates }: { updates: MunicipalityUpdateViewModel[] }) => { if (!updates.length) { return (
Nenhuma atualização registrada ainda.
) } return ({update.body ?? 'Sem texto.'}
{update.activeVolunteers != null || update.newSupports != null ? ({update.activeVolunteers != null ? `${numberFormatter.format(update.activeVolunteers)} voluntários ativos` : null} {update.activeVolunteers != null && update.newSupports != null ? ' · ' : null} {update.newSupports != null ? `${numberFormatter.format(update.newSupports)} novos apoios` : null}
) : null}