21 lines
685 B
TypeScript
21 lines
685 B
TypeScript
import { db } from "@/lib/db";
|
||
import { notFound } from "next/navigation";
|
||
import MatchForm from "../../MatchForm";
|
||
|
||
export default async function EditMatchPage({ params }: { params: { id: string } }) {
|
||
const [match, countries, rounds] = await Promise.all([
|
||
db.match.findUnique({ where: { id: params.id } }),
|
||
db.country.findMany({ orderBy: { name: "asc" } }),
|
||
db.round.findMany({ orderBy: { number: "asc" } }),
|
||
]);
|
||
|
||
if (!match) notFound();
|
||
|
||
return (
|
||
<div className="max-w-xl">
|
||
<h1 className="text-2xl font-bold mb-6">ویرایش بازی</h1>
|
||
<MatchForm countries={countries} rounds={rounds} matchId={match.id} initial={match} />
|
||
</div>
|
||
);
|
||
}
|