import Events from "./_components/FeaturedEvents";
import { Stats } from "./_components/Stats";
import { Badges } from "./_components/Badges";
import { RecentFlights } from "(app)/_components/RecentFlights";
import { Bookings } from "(app)/_components/Bookings";

export default async function Home({
	searchParams,
}: {
	searchParams: Promise<{ stats?: "pilot" | "dispo" }>;
}) {
	const { stats } = await searchParams;
	const view = stats || "pilot";
	return (
		<div>
			<Stats stats={view} />
			<div className="grid grid-cols-6 gap-4">
				<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-3">
					<RecentFlights />
				</div>
				<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-3">
					<Bookings />
				</div>
				<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-3">
					<Badges />
				</div>
			</div>
			<Events />
		</div>
	);
}
