import Link from 'next/link' import { ContentPieceCirculationCounters } from '@/components/campaign/content/ContentPieceCirculationCounters' import { ContentPieceRetryButton } from '@/components/campaign/content/ContentPieceRetryButton' import { ContentPieceProcessingBadge, ContentPiecePublicationBadge, } from '@/components/campaign/content/ContentPieceStatusBadge' import { Button } from '@/components/ui/button' import { contentPieceStepLabels } from '@/lib/contentPiece' import type { ContentPieceRowViewModel } from '@/lib/contentPieceCirculation' /** * C211 — the Central list on mobile (approved design scenes 5): one card per * piece with the title + processing state, the type/publication line and the * single "Abrir" (or "Reprocessar" when it failed). C213 adds the piece's * circulation counters (2×2 grid) right above the action. */ export const ContentPieceCardList = ({ rows, empty, }: { rows: readonly ContentPieceRowViewModel[] empty?: React.ReactNode }) => (
{rows.length === 0 && empty ? empty : null} {rows.map((piece) => (
{piece.title}
{[piece.typeLabel, piece.durationLabel].filter(Boolean).join(' · ')} {piece.cityLabel ? ` · ${piece.cityLabel}` : ''}
{piece.processingStatus === 'processando' ? ( <>

{piece.step ? contentPieceStepLabels[piece.step] : 'Processando…'}

) : piece.processingStatus === 'falhou' && piece.failureMessage ? (

{piece.failureMessage}

) : null} {piece.canRetry ? ( ) : ( )}
))}
)