import { Link, router } from '@inertiajs/react'; import { Field, Management, button, control } from './shared'; export const states: Record = { draft: 'Rascunho', submitted: 'Submetido', in_review: 'Em revisão', approved: 'Aprovado', published: 'Publicado', returned: 'Devolvido', rejected: 'Rejeitado', archived: 'Arquivado', }; type Item = { id: number; title: string; revision_no: number; state: string; responsible: string | null; published: boolean; legal_required: boolean; }; const eventTitles: Record = { submitted: 'Submissão', pending_review: 'Submissão', review_started: 'Início da revisão', in_review: 'Início da revisão', returned: 'Devolução', rejected: 'Rejeição', approved: 'Aprovação', published: 'Publicação', archived: 'Arquivo', withdrawn: 'Retirada da publicação', publication_withdrawn: 'Retirada da publicação', suspended: 'Suspensão da publicação', submit: 'Submissão', start_review: 'Início da revisão', return: 'Devolução', reject: 'Rejeição', legal_validate: 'Validação jurídica', approve: 'Aprovação', publish: 'Publicação', archive: 'Arquivo', }; export default function EditorialWorkflow({ items, notices, filters = {}, resourceAccess, opportunitiesUrl, opportunityPending, clustersUrl, portfolioUrl, portfolioPending = 0, demographyUrl, demographyPending = 0, territorialUrl, nativePending = { clusters: 0, territories: 0 }, subjectsUrl, subjectsPending = 0, zonesUrl, }: { resourceAccess: boolean; opportunitiesUrl: string | null; opportunityPending: number; clustersUrl?: string | null; portfolioUrl?: string | null; portfolioPending?: number; demographyUrl?: string | null; demographyPending?: number; territorialUrl?: string | null; nativePending?: { clusters: number; territories: number; zones?: number }; zonesUrl?: string | null; subjectsUrl?: string | null; subjectsPending?: number; filters?: { state?: string; kind?: string }; items: { data: Item[]; current_page: number; last_page: number }; notices: { id: number; action: string; read_at: string | null; href: string; reference: string; }[]; }) { const pageUrl = (page: number) => `/management/editorial?${new URLSearchParams({ ...filters, page: String(page) })}`; return (

Artigos, legislação e documentos: edições privadas e versão pública separadas. As oportunidades mantêm o seu circuito próprio.

{zonesUrl && ( Zonas e indicadores: {nativePending.zones ?? 0}{' '} pendentes )} {subjectsUrl && ( Estruturas e relações: {subjectsPending} pendentes )} {demographyUrl && ( Demografia: {demographyPending} lotes pendentes )} {territorialUrl && ( Conteúdos territoriais: {nativePending.territories}{' '} pendentes )} {portfolioUrl && ( Carteira: {portfolioPending} fichas pendentes )} {clustersUrl && ( Competitividade dos clusters: {nativePending.clusters}{' '} pendentes )} Painel geral {resourceAccess && ( Biblioteca e editores )} {opportunitiesUrl && ( Oportunidades )}
{opportunitiesUrl && (

Oportunidades

{opportunityPending} conteúdos pendentes no seu âmbito de acesso.

Continuar na fila de oportunidades existente
)} {resourceAccess && ( <>
{items.data.map((item) => (
{item.title}

Edição {item.revision_no} ·{' '} {states[item.state] ?? item.state} · Responsável:{' '} {item.responsible ?? 'Por atribuir'}

{item.published ? 'Versão pública disponível' : 'Sem versão pública'} {item.legal_required && ' · Exige validação jurídica'}

))}
)}

Notificações

{notices.map((n) => (

{eventTitles[n.action] ?? 'Alteração editorial'} ·{' '} {n.reference} {!n.read_at && ( )}

))}
); }