judge4c/src/app/(app)/problems/[id]/@Submissions/page.tsx

49 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-04-13 04:06:08 +00:00
import prisma from "@/lib/prisma";
import { notFound } from "next/navigation";
import SubmissionsTable from "@/components/submissions-table";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
interface SubmissionsPageProps {
params: Promise<{ id: string }>;
}
export default async function SubmissionsPage({ params }: SubmissionsPageProps) {
const { id } = await params;
if (!id) {
return notFound();
}
const problem = await prisma.problem.findUnique({
where: { id },
select: {
submissions: {
include: {
testcaseResults: {
include: {
testcase: {
include: {
data: true,
},
},
},
},
},
},
2025-04-13 04:06:08 +00:00
},
});
if (!problem) {
return notFound();
}
return (
<div className="px-3 flex flex-col h-full border border-t-0 border-muted rounded-b-3xl bg-background">
<ScrollArea className="h-full">
<SubmissionsTable submissions={problem.submissions} />
<ScrollBar orientation="horizontal" />
</ScrollArea>
</div>
);
}