mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
40 lines
822 B
TypeScript
40 lines
822 B
TypeScript
import prisma from "@/lib/prisma";
|
|
import { notFound } from "next/navigation";
|
|
import TestcaseCard from "@/components/testcase-card";
|
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
|
|
interface TestcasePageProps {
|
|
params: Promise<{ id: string }>;
|
|
}
|
|
|
|
export default async function TestcasePage({ params }: TestcasePageProps) {
|
|
const { id } = await params;
|
|
|
|
if (!id) {
|
|
return notFound();
|
|
}
|
|
|
|
const problem = await prisma.problem.findUnique({
|
|
where: { id },
|
|
select: {
|
|
testcases: {
|
|
include: {
|
|
data: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
if (!problem) {
|
|
return notFound();
|
|
}
|
|
|
|
return (
|
|
<div className="absolute h-full w-full">
|
|
<ScrollArea className="h-full">
|
|
<TestcaseCard testcases={problem.testcases} />
|
|
</ScrollArea>
|
|
</div>
|
|
);
|
|
}
|