diff --git a/src/app/(app)/problemset/page.tsx b/src/app/(app)/problemset/page.tsx index c541c03..ddff828 100644 --- a/src/app/(app)/problemset/page.tsx +++ b/src/app/(app)/problemset/page.tsx @@ -8,6 +8,8 @@ import { TableRow, } from "@/components/ui/table"; import prisma from "@/lib/prisma"; +import { auth } from "@/lib/auth"; +import { CircleCheckBigIcon } from "lucide-react"; import { getDifficultyColorClass } from "@/lib/utils"; export default async function ProblemsetPage() { @@ -23,11 +25,28 @@ export default async function ProblemsetPage() { }, }); + const session = await auth(); + + let completedProblems: string[] = []; + if (session?.user) { + const submissions = await prisma.submission.findMany({ + where: { + userId: session.user.id, + status: "AC", + }, + select: { + problemId: true, + }, + }); + + completedProblems = submissions.map(sub => sub.problemId); + } + return (