"use client"; import { useState, useEffect } from 'react'; import { databases, APPWRITE_ALMEIRA_CONFIG, Query } from '@/lib/appwrite'; import { NewsCard } from '@/components/NewsCard'; import { GlobalSidebar } from '@/components/AdWrappers'; import { Loader2, RadioTower, Sparkles, ChevronDown } from 'lucide-react'; export default function Home() { const [posts, setPosts] = useState([]); const [isLoading, setIsLoading] = useState(true); useEffect(() => { const fetchLatestPosts = async () => { try { const response = await databases.listDocuments( APPWRITE_ALMEIRA_CONFIG.databaseId, APPWRITE_ALMEIRA_CONFIG.collections.posts, [ Query.equal('tipo', 'noticia'), Query.orderDesc('$createdAt'), Query.limit(6) ] ); setPosts(response.documents); } catch (error) { console.error("Error fetching posts:", error); } finally { setIsLoading(false); } }; fetchLatestPosts(); }, []); return (
{/* Sci-Fi Hero Section */}
{/* Dynamic Orbs background */}
Señal En Vivo 24/7

NOTICIAS AL
SIGUIENTE NIVEL

El primer portal transaccional hiperconectado. Sumérgete en la actualidad de la región en tiempo real con una interfaz sin precedentes.

{/* Scroll Indicator */}
document.getElementById('noticias')?.scrollIntoView({ behavior: 'smooth'})}> Descubrir
{/* Feed Section */}
Último Minuto

Feed de Noticias

{isLoading ? (

Sincronizando Noticias...

) : posts.length === 0 ? (

Sin Conexión Reciente

El portal se encuentra a la espera de señales desde el núcleo central.

) : (
{posts.map((post) => ( ))}
)}
); }