Module Update
Some checks failed
CI / build-and-test (push) Failing after 1m31s
CI / deploy (push) Has been skipped

This commit is contained in:
SpecialX
2025-12-30 14:42:30 +08:00
parent f1797265b2
commit e7c902e8e1
148 changed files with 19317 additions and 113 deletions

View File

@@ -0,0 +1,47 @@
import { Suspense } from "react"
import Link from "next/link"
import { Button } from "@/shared/components/ui/button"
import { ExamDataTable } from "@/modules/exams/components/exam-data-table"
import { examColumns } from "@/modules/exams/components/exam-columns"
import { ExamFilters } from "@/modules/exams/components/exam-filters"
import { getExams } from "@/modules/exams/data-access"
export default async function AllExamsPage({
searchParams,
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) {
const params = await searchParams
const exams = await getExams({
q: params.q as string,
status: params.status as string,
difficulty: params.difficulty as string,
})
return (
<div className="flex h-full flex-col space-y-8 p-8">
<div className="flex flex-col justify-between space-y-4 md:flex-row md:items-center md:space-y-0">
<div>
<h2 className="text-2xl font-bold tracking-tight">All Exams</h2>
<p className="text-muted-foreground">View and manage all your exams.</p>
</div>
<div className="flex items-center space-x-2">
<Button asChild>
<Link href="/teacher/exams/create">Create Exam</Link>
</Button>
</div>
</div>
<div className="space-y-4">
<Suspense fallback={<div className="h-10 w-full animate-pulse rounded-md bg-muted" />}>
<ExamFilters />
</Suspense>
<div className="rounded-md border bg-card">
<ExamDataTable columns={examColumns} data={exams} />
</div>
</div>
</div>
)
}