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

22 lines
714 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
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 MatchForm from "../../MatchForm";
export default async function EditMatchPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const [match, countries, rounds] = await Promise.all([
db.match.findUnique({ where: { 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>
);
}