test / test (push) Failing after 6m52s
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import Link from "next/link";
|
|
import { redirect } from "next/navigation";
|
|
import { BackgroundBlobs } from "@/components/background-blobs";
|
|
import { getSessionUser } from "@/lib/auth";
|
|
import { PaperForm } from "../paper-form";
|
|
|
|
// xuchao: 新建试卷页(paperId 唯一;科目/年级/学期固定 math/g7/s1,孩子端立即出现)
|
|
export default async function NewExamPage() {
|
|
const parent = await getSessionUser();
|
|
if (!parent) redirect("/login");
|
|
if (parent.role !== "parent") redirect("/kid");
|
|
|
|
return (
|
|
<main className="relative mx-auto max-w-3xl space-y-5 p-4 pb-10">
|
|
<BackgroundBlobs />
|
|
<header className="space-y-2">
|
|
<Link href="/parent/exams" className="text-sm font-medium text-indigo-600">
|
|
← 试卷列表
|
|
</Link>
|
|
<h1 className="text-xl font-extrabold break-words text-slate-900">新建试卷</h1>
|
|
</header>
|
|
<div className="rounded-2xl border border-slate-100 bg-white p-5 shadow-soft">
|
|
<PaperForm paper={null} isNew />
|
|
</div>
|
|
</main>
|
|
);
|
|
}
|