import { db } from "@/lib/db"; import StatsForm from "./StatsForm"; export default async function AdminStatsPage({ searchParams, }: { searchParams: { matchId?: string }; }) { const matches = await db.match.findMany({ include: { homeTeam: true, awayTeam: true }, orderBy: { matchDate: "desc" }, }); const selectedMatch = searchParams.matchId ? await db.match.findUnique({ where: { id: searchParams.matchId }, include: { homeTeam: { include: { players: true } }, awayTeam: { include: { players: true } }, playerStats: { include: { player: true } }, }, }) : null; return (