mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-29 17:43:05 +00:00
Envio em lote (1 request raw-body por arquivo, fan-out ≤2, até 50 arquivos) e adicionar por link (Instagram/YouTube; extração só pela Graph API da conta própria, senão peça-link) em /campanha/comunicacao/conteudos. Cada peça tem estado próprio (Processando/Pronto/Falhou + Reprocessar), transcrição/texto e catalogação automática revisável; publicar/despublicar preserva arquivo, slug e publishedAt. - collections contentPiece + contentMedia (upload privado no S3) e migration 20260923_032714_add_content_piece (slug único gerado no 1º publish, sourceUrl única, searchText com índice trigram) - pipeline reusa C199 (job after() + reaper + retry condicional, transcrição DeepInfra, ffmpeg/chunk), o classificador de facetas do acervo e o institutionCatalog; curatedFields impede o job de sobrescrever curadoria - gate único canReadCommunicationCatalog (advisor/leader negados); delete só pelo admin; sem Consent novo - UI portada do design aprovado (lista desktop + cards mobile, diálogo de lote com progresso por arquivo, diálogo de link, ficha editável, kill switch); nav/chrome/column-picker/manifest atualizados - instagramFeed expõe mediaUrl; revalidateTag ganha wrapper seguro fora de request (fixtures/scripts) - testes: 2 unit specs, 1 int spec (16 casos) e 7 e2e na vertical - follow-up de engenharia: #1267 (docs/plans/escala-dry-pos-c211.md) Closes #1254
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import {
|
|
contentPieceProcessingStatusLabels,
|
|
contentPieceStatusLabels,
|
|
type ContentPieceProcessingStatus,
|
|
type ContentPieceStatus,
|
|
} from '@/lib/contentPiece'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const PROCESSING_TONE: Record<ContentPieceProcessingStatus, string> = {
|
|
processando: 'bg-amber-100 text-amber-900',
|
|
pronto: 'bg-green-100 text-green-800',
|
|
falhou: 'bg-red-100 text-red-700',
|
|
}
|
|
|
|
const PUBLICATION_TONE: Record<ContentPieceStatus, string> = {
|
|
rascunho: 'bg-muted text-muted-foreground',
|
|
publicado: 'bg-rose-50 text-rose-900 ring-1 ring-rose-200',
|
|
}
|
|
|
|
/** C211 — the one processing chip of the Central surfaces (list and ficha). */
|
|
export const ContentPieceProcessingBadge = ({
|
|
status,
|
|
className,
|
|
}: {
|
|
status: ContentPieceProcessingStatus
|
|
className?: string
|
|
}) => (
|
|
<span
|
|
className={cn(
|
|
'inline-flex min-h-5 items-center rounded-full px-2 py-0.5 text-xs font-semibold',
|
|
PROCESSING_TONE[status],
|
|
className,
|
|
)}
|
|
>
|
|
{contentPieceProcessingStatusLabels[status]}
|
|
</span>
|
|
)
|
|
|
|
/** C211 — the publication chip: "Rascunho" is off the public Central. */
|
|
export const ContentPiecePublicationBadge = ({
|
|
status,
|
|
className,
|
|
}: {
|
|
status: ContentPieceStatus
|
|
className?: string
|
|
}) => (
|
|
<span
|
|
className={cn(
|
|
'inline-flex min-h-5 items-center rounded-full px-2 py-0.5 text-xs font-semibold',
|
|
PUBLICATION_TONE[status],
|
|
className,
|
|
)}
|
|
>
|
|
{contentPieceStatusLabels[status]}
|
|
</span>
|
|
)
|