import { EventCard } from "@/components/events/EventCard"; import { Navbar } from "@/components/layout/Navbar"; import { Footer } from "@/components/layout/Footer"; import { appName } from "@/lib/siteConfig"; import { Calendar, UserPlus, ArrowRight, CalendarCheck, Users, Heart, ShieldCheck } from "lucide-react"; type Event = { id: string; title: string; description?: string; startDate: string; endDate: string; registrationDeadline?: string | null; goLiveAt?: string; price: number; picture?: string; }; import { apiFetch } from "@/lib/api"; const FEATURES = [ { icon: CalendarCheck, title: "Meaningful Events", description: "Events designed to inspire, encourage and strengthen your faith." }, { icon: Calendar, title: "Easy Registration", description: "Simple and secure registration so you can focus on what matters." }, { icon: Users, title: "Community", description: "Connect with others and grow in a supportive and loving community." }, { icon: Heart, title: "Make an Impact", description: "Be part of what God is doing and make a difference together." }, ]; export default async function HomePage() { const events = await apiFetch("/api/events", { nextOptions: { next: { revalidate: 60 } } }); const now = Date.now(); const upcoming = (events || []).filter(e => { const t = new Date(e.startDate).getTime(); return !isNaN(t) && t > now; }); const sorted = [...upcoming].sort((a, b) => new Date(a.startDate).getTime() - new Date(b.startDate).getTime()); return (

Upcoming Events

View all events
{sorted.length === 0 ? (

No upcoming events right now — check back soon.

) : (
{sorted.slice(0, 3).map(event => ( ))}
)}
{FEATURES.map(f => { const Icon = f.icon; return (

{f.title}

{f.description}

); })}

Secure & reliable

Your details and payments are handled securely from registration through to the day of the event.

); }