import { ChevronLeftIcon, ChevronRightIcon, MessageSquareTextIcon } from 'lucide-react' import Link from 'next/link' import { Badge } from '@/components/ui/Badge' import { Button } from '@/components/ui/button' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@/components/ui/Empty' import { formatRelativeAge } from '@/utilities/formatRelativeAge' import type { NucleusUpdatesPageData } from '@/utilities/nucleusUpdatePageData' import { buildNucleusUpdateHref, nucleusUpdateKindLabels, type NucleusUpdateListState, type NucleusUpdateViewModel, } from '@/utilities/nucleusUpdateUi' const roleLabels: Record = { geral: 'Coordenação geral', coordenador: 'Coordenador', lideranca: 'Liderança', } const updateFilters: Array<{ label: string; state: NucleusUpdateListState }> = [ { label: 'Todas', state: { page: 1 } }, ...Object.entries(nucleusUpdateKindLabels).map(([kind, label]) => ({ label, state: { kind: kind as NucleusUpdateListState['kind'], page: 1 }, })), ] const UpdateCard = ({ update, now }: { update: NucleusUpdateViewModel; now: string }) => (
{nucleusUpdateKindLabels[update.kind]} {formatRelativeAge(new Date(update.createdAt).getTime(), new Date(now).getTime())}
{update.authorName}

{roleLabels[update.authorRole]}

{update.kind === 'semanal' ? ( <>

O que funcionou

{update.worked}

O que não funcionou

{update.failed}

O que preciso

{update.needs}

{update.activeVolunteers !== null || update.newSupports !== null ? (
{update.activeVolunteers !== null ? (
Voluntários ativos
{update.activeVolunteers}
) : null} {update.newSupports !== null ? (
Novos apoios
{update.newSupports}
) : null}
) : null} ) : (

{update.body}

)}
) export const NucleusUpdateFeed = ({ nucleusSlug, pageData, rawSearchParams, now, }: { nucleusSlug: string pageData: NucleusUpdatesPageData rawSearchParams: Record now: string }) => (
{pageData.updates.length ? (
{pageData.updates.map((update) => ( ))}
) : ( Nenhuma atualização neste filtro Envie o primeiro reporte para iniciar o histórico cronológico do núcleo. )} {pageData.totalPages > 1 ? ( ) : null}
)