import { Badge } from '@/components/ui/Badge' import { municipalitySignalTypeLabels, municipalityUpdateKindLabels, } 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') const kindVariant = { semanal: 'secondary', urgente: 'destructive', nota: 'outline', sinal: 'default', } as const export const MunicipalityUpdateFeed = ({ updates }: { updates: MunicipalityUpdateViewModel[] }) => { if (!updates.length) { return (
Nenhuma atualização registrada ainda.
) } return ({update.body}
)} {update.kind === 'sinal' && update.signalType ? ({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}