Files
football-next/app/(admin)/admin/countries/[id]/lineup/page.tsx
2026-04-07 10:38:28 +03:30

30 lines
995 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { db } from "@/lib/db";
import { notFound } from "next/navigation";
import Link from "next/link";
import DefaultLineupEditor from "./DefaultLineupEditor";
export default async function CountryDefaultLineupPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const [country, players] = await Promise.all([
db.country.findUnique({ where: { id } }),
db.player.findMany({
where: { countryId: id, isActive: true },
orderBy: [{ position: "asc" }, { name: "asc" }],
}),
]);
if (!country) notFound();
return (
<div className="max-w-6xl mx-auto">
<div className="flex items-center gap-3 mb-6">
<Link href="/admin/countries" className="text-gray-400 hover:text-gray-600"> تیمها</Link>
<h1 className="text-2xl font-bold">ترکیب پیشفرض {country.name} {country.flagUrl}</h1>
</div>
<DefaultLineupEditor country={country} players={players} />
</div>
);
}