import { Badge } from '@/components/ui/Badge' import { plazaUpdateKindLabels } from '@/lib/schemas/plazaUpdate' import type { PlazaUpdateViewModel } from '@/utilities/plazaUpdatePageData' 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', } as const export const PlazaUpdateFeed = ({ updates }: { updates: PlazaUpdateViewModel[] }) => { if (!updates.length) { return (
Nenhuma atualização registrada ainda.
) } return ({update.body}
)} {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}