mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 11:33:07 +00:00
Fold duplicated campanha access, loaders, list/filter/form shells, and scripts into shared modules; reorganize utilities by domain; stabilize e2e; and document prevention-first audit workflow so the same smells cannot creep back in.
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
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 type { ActivityUpdateViewModel } from '@/utilities/activityViewModels'
|
|
|
|
const UpdateCard = ({ update }: { update: ActivityUpdateViewModel }) => (
|
|
<article>
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle className="text-base">{update.authorName ?? 'Autor removido'}</CardTitle>
|
|
<p className="text-sm text-muted-foreground">
|
|
{update.createdAt ? formatBahiaDateTimeLabel(update.createdAt) : ''}
|
|
</p>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<p className="whitespace-pre-wrap">{update.body}</p>
|
|
</CardContent>
|
|
</Card>
|
|
</article>
|
|
)
|
|
|
|
export const ActivityUpdateFeed = ({ updates }: { updates: ActivityUpdateViewModel[] }) => {
|
|
if (!updates.length) {
|
|
return (
|
|
<Empty className="border">
|
|
<EmptyHeader>
|
|
<EmptyMedia variant="icon">
|
|
<MessageSquareTextIcon aria-hidden="true" />
|
|
</EmptyMedia>
|
|
<EmptyTitle>Nenhuma atualização registrada</EmptyTitle>
|
|
<EmptyDescription>
|
|
Envie o primeiro reporte para iniciar o histórico cronológico desta atividade.
|
|
</EmptyDescription>
|
|
</EmptyHeader>
|
|
</Empty>
|
|
)
|
|
}
|
|
|
|
const sortedUpdates = [...updates].reverse()
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4">
|
|
{sortedUpdates.map((update, index) => (
|
|
<UpdateCard key={update.id ?? index} update={update} />
|
|
))}
|
|
</div>
|
|
)
|
|
}
|