import { db } from "@/lib/db"; import PositionBadge from "@/components/PositionBadge"; export default async function PlayersPage({ searchParams, }: { searchParams: { position?: string; country?: string }; }) { const players = await db.player.findMany({ where: { ...(searchParams.position ? { position: searchParams.position as any } : {}), ...(searchParams.country ? { countryId: searchParams.country } : {}), }, include: { country: true }, orderBy: { totalPoints: "desc" }, }); const countries = await db.country.findMany({ orderBy: { name: "asc" } }); return (
| # | بازیکن | پست | تیم ملی | قیمت | امتیاز |
|---|---|---|---|---|---|
| {i + 1} | {p.name} |
|
{p.country.name} | {p.price}M | {p.totalPoints} |