import { getNoticias, getServerStatus, type Noticia, type ServerStatus } from '@/lib/home' // SSR por petición: los datos se leen DIRECTAMENTE de MySQL desde el servidor Next // (sin Django). force-dynamic para renderizar por petición. export const dynamic = 'force-dynamic' async function getData(): Promise<{ noticias: Noticia[]; status: ServerStatus | null }> { const [news, status] = await Promise.allSettled([getNoticias(), getServerStatus()]) return { noticias: news.status === 'fulfilled' ? news.value : [], status: status.status === 'fulfilled' ? status.value : null, } } export default async function HomePage() { const { noticias, status } = await getData() return (

Nova WoW

Estado del servidor

{status ? ( ) : (

No disponible.

)}

Noticias

{noticias.length === 0 ? (

No hay noticias disponibles en este momento.

) : ( noticias.map((n) => (

{n.titulo}

{n.fecha && {new Date(n.fecha).toLocaleString('es-ES')}}
{n.enlace && (

Enlace:{' '} aquí

)}
)) )}
) }