import { db } from "@/lib/db"; import { notFound } from "next/navigation"; import Link from "next/link"; import DeleteMatchButton from "./DeleteMatchButton"; const statusStyle: Record = { SCHEDULED: "bg-gray-100 text-gray-600", LIVE: "bg-red-100 text-red-600", FINISHED: "bg-green-100 text-green-700", }; const statusLabel: Record = { SCHEDULED: "برنامه", LIVE: "🔴 زنده", FINISHED: "پایان" }; export default async function RoundDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const round = await db.round.findUnique({ where: { id }, include: { matches: { include: { homeTeam: true, awayTeam: true, _count: { select: { events: true, lineups: true } }, }, orderBy: { matchDate: "asc" }, }, }, }); if (!round) notFound(); return (
← دورها

{round.name}

{round.isActive && فعال}
+ افزودن بازی
{round.matches.map((m) => (
{m.homeTeam.name} {m.homeTeam.flagUrl}
{m.status !== "SCHEDULED" ? (
{m.homeScore} - {m.awayScore}
) : (
{new Date(m.matchDate).toLocaleDateString("fa-IR")}
)} {statusLabel[m.status]}
{m.awayTeam.flagUrl} {m.awayTeam.name}
{m._count.events} رویداد
{m._count.lineups > 0 ? "✓ ترکیب" : "بدون ترکیب"}
جزئیات ویرایش 0} />
))} {round.matches.length === 0 && (

هنوز بازی‌ای برای این دور ثبت نشده

افزودن اولین بازی
)}
); }