import { PostCard } from '@/components/PostCard' import { Media } from '@/payload-types' import { getCachedDocumentById } from '@/utilities/documentReads' import { getCachedGlobal } from '@/utilities/globalReads' import { getTypePath, getVisiblePosts } from '@/utilities/posts' import Image from 'next/image' import Link from 'next/link' const LATEST_NEWS_LIMIT = 6 export default async function ArtigosPage() { const home = await getCachedGlobal('home', 2)() let heroImage: Media | null = null if (typeof home.image === 'number') { heroImage = await getCachedDocumentById('media', `${home.image}`)() } else { heroImage = home.image ?? null } const latestNews = (await getVisiblePosts()) .filter((post) => post.type === 'noticia') .slice(0, LATEST_NEWS_LIMIT) return (

O mandato do tamanho da Bahia

Notícias, campanhas e a atuação do deputado Jorge Solla por uma Bahia mais justa.

Ver notícias
{heroImage?.url ? (
{heroImage.alt}
) : null}

Últimas notícias

Ver todas
{latestNews.length ? (
{latestNews.map((post) => ( ))}
) : (

Nenhuma notícia publicada ainda.

)}
) }