Files
football-next/app/(user)/golden-cards/page.tsx
2026-05-03 17:01:46 +03:30

21 lines
590 B
TypeScript

import { requireAuth } from "@/lib/session";
import { db } from "@/lib/db";
import GoldenCardsClient from "./GoldenCardsClient";
export default async function GoldenCardsPage() {
const session = await requireAuth();
const userId = (session.user as any).id;
const cards = await db.goldenCard.findMany({
where: { userId },
include: { player: { include: { country: true } } },
orderBy: { acquiredDate: "desc" },
});
return (
<div className="min-h-screen bg-gray-950 text-white py-10 px-4">
<GoldenCardsClient initialCards={cards as any} />
</div>
);
}