import React from 'react'; import { Eye, MapPin, CheckCircle, Clock } from 'lucide-react'; import { api, Sighting } from '@/lib/api'; import { format } from 'date-fns'; import type { Metadata } from 'next'; import ReportForm from './ReportForm'; export const metadata: Metadata = { title: 'Wildlife Sightings', description: 'Browse recent wildlife sightings and report your own in Cape Coral.', }; const SPECIES_EMOJI: Record = { 'Burrowing Owl': '🦉', 'Gopher Tortoise': '🐢', 'Roseate Spoonbill': '🦩', 'Scrub-Jay': '🐦', 'Manatee': '🐋', }; async function getSightings(): Promise { try { return await api.getSightings(); } catch { return []; } } export default async function SightingsPage() { const sightings = await getSightings(); return (
Community Science

Wildlife Sightings

Help us track Cape Coral's wildlife. Report what you see — every sighting helps conservation efforts.

{/* Report Form */} {/* Recent Sightings */}

Recent Sightings

{sightings.length === 0 ? (

No sightings yet

Be the first to report a wildlife sighting!

) : (
{sightings.map((s) => (
{/* Species icon */}
{SPECIES_EMOJI[s.species] || '🦎'}

{s.species}

{s.gps_lat.toFixed(4)}°N, {Math.abs(s.gps_lng).toFixed(4)}°W

{s.verified ? ( Verified ) : ( Pending )}
{s.description && (

{s.description}

)}
{s.reporter && Reported by {s.reporter.name}} {format(new Date(s.created_at), 'MMM d, yyyy')}
))}
)}
); }