nomadweb/frontend/src/app/page.tsx
2026-08-28 19:49:10 -05:00

61 lines
1.5 KiB
TypeScript

import { api } from "@/lib/api";
import HomeClient from "@/components/HomeClient";
export const revalidate = 60;
export default async function Home() {
try {
const [stats, ticker, destinations, visas, faqs, testimonials, tools, blog, cost, speed, growth, radar] =
await Promise.all([
api.getStats(),
api.getTicker(),
api.getDestinations(),
api.getVisas(),
api.getFaqs(),
api.getTestimonials(),
api.getTools(),
api.getBlog(),
api.getChartCost(),
api.getChartSpeed(),
api.getChartGrowth(),
api.getChartRadar(),
]);
return (
<HomeClient
stats={stats}
ticker={ticker.messages}
destinations={destinations}
visas={visas}
faqs={faqs}
testimonials={testimonials}
tools={tools}
blog={blog}
charts={{ cost, speed, growth, radar }}
/>
);
} catch {
// Minimal fallback if API completely unavailable
const stats = await api.getStats();
const ticker = await api.getTicker();
return (
<HomeClient
stats={stats}
ticker={ticker.messages}
destinations={[]}
visas={[]}
faqs={[]}
testimonials={[]}
tools={[]}
blog={[]}
charts={{
cost: { labels: [], datasets: [{ data: [] }] },
speed: { labels: [], datasets: [{ data: [] }] },
growth: { labels: [], datasets: [{ data: [] }] },
radar: { labels: [], datasets: [] },
}}
/>
);
}
}