import React from 'react';
import Link from 'next/link';
import { Tv2, Heart, ChevronRight, TreePine, Calendar } from 'lucide-react';
import { api, Stream, Stat } from '@/lib/api';
import StatsBar from './components/StatsBar';
import StreamCard from './components/StreamCard';
async function getData(): Promise<{ stats: Stat | null; streams: Stream[] }> {
try {
const [stats, streams] = await Promise.all([api.getStats(), api.getStreams()]);
return { stats, streams: streams.slice(0, 3) };
} catch {
return { stats: null, streams: [] };
}
}
export default async function Home() {
const { stats, streams } = await getData();
return (
{/* Hero */}
{/* Background gradient */}
{/* Decorative circles */}
{/* Live badge */}
Cameras Live Now
Watch Cape Coral's
Burrowing Owls
Live
Free, 24/7 wildlife cameras brought to you by Cape Coral Friends of Wildlife. Watch, learn, and help protect Florida's native species.
Watch Live Cams
Support the Mission
{/* Stats Bar */}
{stats && (
)}
{/* Latest Streams */}
{streams.length > 0 && (
Live Cameras
Watch our wildlife cams in real time
View all
{streams.map((s) => )}
)}
{/* Mission CTA grid */}
{[
{
icon: TreePine,
title: 'Wildlife Guide',
desc: 'Learn about burrowing owls, gopher tortoises, scrub-jays, and manatees.',
href: '/wildlife',
cta: 'Explore Species',
color: 'text-emerald-400',
},
{
icon: Heart,
title: 'Support CCFW',
desc: 'Your donation funds cameras, land preservation, and volunteer programs.',
href: '/donate',
cta: 'Donate Now',
color: 'text-gold',
},
{
icon: Calendar,
title: 'Upcoming Events',
desc: 'Join cleanups, educational walks, and community conservation events.',
href: '/events',
cta: 'See Events',
color: 'text-teal',
},
].map(({ icon: Icon, title, desc, href, cta, color }) => (
))}
);
}