import { MessageSquareTextIcon } from 'lucide-react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@/components/ui/Empty' import { formatBahiaDateTimeLabel } from '@/lib/campaignTime' import { GOOGLE_REVERSE_EDIT_BODY_PREFIX } from '@/lib/googleCalendarReverseEdit' import type { ActivityUpdateViewModel } from '@/utilities/activityViewModels' const UpdateCard = ({ update }: { update: ActivityUpdateViewModel }) => { // C115 — reverse-direction records carry no campaign author; the body // prefix attributes the entry to Google Calendar. const googleRecord = update.body.startsWith(GOOGLE_REVERSE_EDIT_BODY_PREFIX) return (
{update.authorName ?? (googleRecord ? 'Google Calendar' : 'Autor removido')}

{update.createdAt ? formatBahiaDateTimeLabel(update.createdAt) : ''}

{update.body}

) } export const ActivityUpdateFeed = ({ updates }: { updates: ActivityUpdateViewModel[] }) => { if (!updates.length) { return ( Nenhuma atualização registrada Envie o primeiro reporte para iniciar o histórico cronológico desta atividade. ) } const sortedUpdates = [...updates].reverse() return (
{sortedUpdates.map((update, index) => ( ))}
) }