P0-1 跨模块直查修复:publish-service 不再直查 examQuestions 表,新增 exams/data-access.addExamQuestions 接口,复用 classes/data-access.getStudentIdsByClassIds P0-2 i18n 接入:新增 zh-CN/en 翻译文件,注册 lessonPreparation 命名空间,17 个组件改造为 useTranslations/getTranslations P1 纯函数抽取:lib/document-migration.ts(类型守卫替代 as 断言)、lib/node-summary.ts(翻译函数注入)、lib/rf-mappers.ts P1 错误边界+骨架屏:新增 LessonPlanErrorBoundary 和 4 个 Skeleton 组件 P1 Block 注册表:新增 config/block-registry.tsx(BlockRenderer 组件),node-edit-panel 重构为配置驱动渲染 P1 其他修复:exercise-block 改用 router.refresh(),node-editor/lesson-node 复用 lib/ 纯函数 架构图同步:更新 004 和 005 文档 Refs: docs/architecture/audit/lesson-preparation-audit-report.md
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import type { JSX } from "react"
|
|
import Link from "next/link"
|
|
import { Plus } from "lucide-react"
|
|
import { getTranslations } from "next-intl/server"
|
|
import { Button } from "@/shared/components/ui/button"
|
|
import { getAuthContext } from "@/shared/lib/auth-guard"
|
|
import { getLessonPlans } from "@/modules/lesson-preparation/data-access"
|
|
import { getSubjectOptions } from "@/modules/school/data-access"
|
|
import { LessonPlanList } from "@/modules/lesson-preparation/components/lesson-plan-list"
|
|
|
|
export const dynamic = "force-dynamic"
|
|
|
|
export default async function LessonPlansPage(): Promise<JSX.Element> {
|
|
const t = await getTranslations("lessonPreparation")
|
|
const ctx = await getAuthContext()
|
|
|
|
const [items, subjects] = await Promise.all([
|
|
getLessonPlans({}, ctx.dataScope, ctx.userId),
|
|
getSubjectOptions(),
|
|
])
|
|
|
|
return (
|
|
<div className="p-6 space-y-4">
|
|
<div className="flex justify-between items-center">
|
|
<div>
|
|
<h1 className="text-2xl font-bold tracking-tight">{t("title.list")}</h1>
|
|
<p className="text-muted-foreground">
|
|
{t("description.list")}
|
|
</p>
|
|
</div>
|
|
<Button asChild>
|
|
<Link href="/teacher/lesson-plans/new">
|
|
<Plus className="h-4 w-4 mr-2" aria-hidden="true" />
|
|
{t("action.new")}
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
<LessonPlanList initialItems={items} subjects={subjects} />
|
|
</div>
|
|
)
|
|
}
|