// page-detalhe.jsx — página de detalhe function driveEmbedFromUrl(url) { if (!url) return null; const match = url.match(/\/file\/d\/([^\/]+)/); if (match) return `https://drive.google.com/file/d/${match[1]}/preview`; return null; } function DetalhePage({ item, setPage, voltarPara }) { if (!item) { return (

Publicação não encontrada.

); } const isProducao = item.kind === 'producao'; const isNoticia = item.kind === 'noticia' || item.kind === 'newsletter'; const temGaleria = (item.galeriaFotos || []).length > 0; // Notícia com PDF: usa embed const noticiaPdfEmbed = isNoticia && item.pdfEmbedUrl ? item.pdfEmbedUrl : null; const noticiaPdfUrl = isNoticia ? item.pdfUrl : null; // Notícia com PDF de SharePoint: tem URL mas pdfEmbedUrl é null // (SharePoint corporativo bloqueia iframe) const noticiaPdfSemEmbed = isNoticia && noticiaPdfUrl && !noticiaPdfEmbed; // Produção com PDF: SEM embed, só link // Detecta se é Drive apenas pra saber o que mostrar no botão const producaoPdf = isProducao ? item.pdf : null; const producaoPdfEhDrive = producaoPdf && producaoPdf.indexOf('drive.google.com') !== -1; const layoutRevista = !!noticiaPdfEmbed; return ( <>
{item.image && (
)}
{item.type} {item.date} {item.readMinutes && ( · {item.readMinutes} min de leitura )}

{item.title}

{isProducao && (item.autores || []).length > 0 && (
por {item.autores.join(', ')} {item.orientador && ( <>
orientação de {item.orientador} )}
)} {isProducao && (item.area || item.notaMencao) && (
{item.area && Área: {item.area}} {item.notaMencao && · {item.notaMencao}}
)}
{/* Corpo textual — notícias ganham classe "corpo-jornal" pra estilos especiais */} {item.content && (
{item.content.split('\n\n').filter(p => p.trim()).map((paragrafo, i) => (

{paragrafo}

))}
)} {/* PDF embutido — SÓ pra notícias com Drive ou OneDrive pessoal */} {noticiaPdfEmbed && (
📄 Documento completo
Abrir em nova aba ↗ Baixar PDF ↓