refactor(modules): update classes, course-plans, diagnostic, questions, settings, student, layout

- Update classes data-access (invitations, main) for invitation management

- Update course-plans actions, data-access, and types

- Update diagnostic data-access for report queries

- Update questions data-access for question bank queries

- Update settings actions, ai-provider-settings-card, data-access, and types

- Update student course-filters, student-courses-view, student-schedule-filters, student-schedule-view

- Update layout app-sidebar, site-header, and navigation config
This commit is contained in:
SpecialX
2026-06-24 12:03:35 +08:00
parent c9e46f9f80
commit 8c2fe14c20
18 changed files with 712 additions and 189 deletions

View File

@@ -4,6 +4,7 @@ import * as React from "react"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { ChevronRight } from "lucide-react"
import { useTranslations } from "next-intl"
import {
Collapsible,
@@ -31,6 +32,8 @@ export function AppSidebar({ mode }: AppSidebarProps) {
const { expanded, toggleSidebar, isMobile } = useSidebar()
const pathname = usePathname()
const { permissions, hasRole } = usePermission()
const tNav = useTranslations("nav")
const tCommon = useTranslations("common")
// 自动检测当前角色(优先级 admin > student > parent > teacher
// 注意grade_head / teaching_head 统一归入 teacher因为 teacher 导航已通过
@@ -86,6 +89,7 @@ export function AppSidebar({ mode }: AppSidebarProps) {
{navItems.map((item, index) => {
const isActive = pathname.startsWith(item.href)
const hasChildren = item.items && item.items.length > 0
const title = tNav(item.title)
if (!expanded && !isMobile) {
// Collapsed Mode (Icon Only + Tooltip)
@@ -100,10 +104,10 @@ export function AppSidebar({ mode }: AppSidebarProps) {
)}
>
<item.icon className="size-5" />
<span className="sr-only">{item.title}</span>
<span className="sr-only">{title}</span>
</Link>
</TooltipTrigger>
<TooltipContent side="right">{item.title}</TooltipContent>
<TooltipContent side="right">{title}</TooltipContent>
</Tooltip>
)
}
@@ -121,7 +125,7 @@ export function AppSidebar({ mode }: AppSidebarProps) {
>
<div className="flex items-center gap-2">
<item.icon className="size-4" />
<span>{item.title}</span>
<span>{title}</span>
</div>
<ChevronRight className="text-muted-foreground size-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" />
</button>
@@ -137,7 +141,7 @@ export function AppSidebar({ mode }: AppSidebarProps) {
pathname === subItem.href && "text-foreground font-medium"
)}
>
{subItem.title}
{tNav(subItem.title)}
</Link>
))}
</div>
@@ -156,7 +160,7 @@ export function AppSidebar({ mode }: AppSidebarProps) {
)}
>
<item.icon className="size-4" />
<span>{item.title}</span>
<span>{title}</span>
{item.href === "/messages" ? <UnreadMessageBadge /> : null}
</Link>
)
@@ -172,7 +176,7 @@ export function AppSidebar({ mode }: AppSidebarProps) {
onClick={toggleSidebar}
className="hover:bg-sidebar-accent text-sidebar-foreground flex w-full items-center justify-center rounded-md border p-2 text-sm transition-colors"
>
{expanded ? "收起" : <ChevronRight className="size-4" />}
{expanded ? tCommon("sidebar.collapse") : <ChevronRight className="size-4" />}
</button>
)}
</div>

View File

@@ -5,6 +5,7 @@ import Link from "next/link"
import { usePathname } from "next/navigation"
import { Menu } from "lucide-react"
import { signOut, useSession } from "next-auth/react"
import { useTranslations } from "next-intl"
import { Button } from "@/shared/components/ui/button"
import { Separator } from "@/shared/components/ui/separator"
@@ -31,7 +32,7 @@ import { NotificationDropdown } from "@/modules/notifications/components/notific
import { useSidebar } from "./sidebar-provider"
import { NAV_CONFIG } from "../config/navigation"
// Build lookup map for breadcrumbs
// Build lookup map for breadcrumbs: href → i18n key
const BREADCRUMB_MAP = new Map<string, string>()
Object.values(NAV_CONFIG).forEach((items) => {
items?.forEach((item) => {
@@ -46,10 +47,12 @@ export function SiteHeader() {
const pathname = usePathname()
const { toggleSidebar, isMobile } = useSidebar()
const { data: session, status } = useSession()
const tNav = useTranslations("nav")
const tCommon = useTranslations("common")
const name = session?.user?.name ?? ""
const email = session?.user?.email ?? ""
const displayName = name || email || (status === "loading" ? "加载中..." : "未登录")
const displayName = name || email || (status === "loading" ? tCommon("user.loading") : tCommon("user.notLoggedIn"))
const fallbackBase = name || email || "?"
const avatarFallback = fallbackBase
@@ -65,7 +68,10 @@ export function SiteHeader() {
const breadcrumbs = segments
.map((segment, index) => {
const href = `/${segments.slice(0, index + 1).join("/")}`
const title = BREADCRUMB_MAP.get(href) || segment.charAt(0).toUpperCase() + segment.slice(1)
const titleKey = BREADCRUMB_MAP.get(href)
const title = titleKey
? tNav(titleKey)
: segment.charAt(0).toUpperCase() + segment.slice(1)
return { href, title, isLast: index === segments.length - 1, isRole: roleSegments.has(segment.toLowerCase()) }
})
.filter((b, idx) => {
@@ -83,7 +89,7 @@ export function SiteHeader() {
{isMobile && (
<Button variant="ghost" size="icon" onClick={toggleSidebar} className="mr-2">
<Menu className="size-5" />
<span className="sr-only">Toggle Sidebar</span>
<span className="sr-only">{tCommon("sidebar.toggleSidebar")}</span>
</Button>
)}
@@ -109,7 +115,7 @@ export function SiteHeader() {
))
) : (
<BreadcrumbItem>
<BreadcrumbPage>Home</BreadcrumbPage>
<BreadcrumbPage>{tCommon("breadcrumb.home")}</BreadcrumbPage>
</BreadcrumbItem>
)}
</BreadcrumbList>
@@ -143,10 +149,10 @@ export function SiteHeader() {
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link href="/profile">Profile</Link>
<Link href="/profile">{tCommon("user.profile")}</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/settings">Settings</Link>
<Link href="/settings">{tCommon("user.settings")}</Link>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
@@ -156,7 +162,7 @@ export function SiteHeader() {
signOut({ callbackUrl: "/login" })
}}
>
Log out
{tCommon("user.logout")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

View File

@@ -31,6 +31,7 @@ import type { Permission, Role } from "@/shared/types/permissions"
export type { Role }
export type NavItem = {
/** i18n key path relative to the "nav" namespace, e.g. "student.dashboard" */
title: string
icon: LucideIcon
href: string
@@ -45,122 +46,122 @@ export type NavItem = {
*/
const COMMON_NAV_ITEMS: NavItem[] = [
{
title: "Announcements",
title: "common.announcements",
icon: Megaphone,
href: "/announcements",
permission: Permissions.ANNOUNCEMENT_READ,
},
{
title: "Messages",
title: "common.messages",
icon: Mail,
href: "/messages",
permission: Permissions.MESSAGE_READ,
},
{
title: "common.aiSettings",
icon: Sparkles,
href: "/admin/ai-settings",
permission: Permissions.AI_CHAT,
},
]
export const NAV_CONFIG: Partial<Record<Role, NavItem[]>> = {
admin: [
{
title: "Dashboard",
title: "admin.dashboard",
icon: LayoutDashboard,
href: "/admin/dashboard",
permission: Permissions.SCHOOL_MANAGE,
},
{
title: "School Management",
title: "admin.schoolManagement",
icon: Shield,
href: "/admin/school",
permission: Permissions.SCHOOL_MANAGE,
items: [
{ title: "Schools", href: "/admin/school/schools" },
{ title: "Grades", href: "/admin/school/grades" },
{ title: "Grade Insights", href: "/admin/school/grades/insights" },
{ title: "Departments", href: "/admin/school/departments" },
{ title: "Classes", href: "/admin/school/classes" },
{ title: "Academic Year", href: "/admin/school/academic-year" },
{ title: "admin.schools", href: "/admin/school/schools" },
{ title: "admin.grades", href: "/admin/school/grades" },
{ title: "admin.gradeInsights", href: "/admin/school/grades/insights" },
{ title: "admin.departments", href: "/admin/school/departments" },
{ title: "admin.classes", href: "/admin/school/classes" },
{ title: "admin.academicYear", href: "/admin/school/academic-year" },
]
},
{
title: "Users",
title: "admin.users",
icon: Users,
href: "/admin/users",
permission: Permissions.USER_MANAGE,
items: [
{ title: "User List", href: "/admin/users" },
{ title: "Import Users", href: "/admin/users/import", permission: Permissions.USER_MANAGE },
{ title: "admin.userList", href: "/admin/users" },
{ title: "admin.importUsers", href: "/admin/users/import", permission: Permissions.USER_MANAGE },
]
},
{
title: "Teaching",
title: "admin.teaching",
icon: BookCopy,
href: "/admin/course-plans",
permission: Permissions.COURSE_PLAN_MANAGE,
items: [
{ title: "Course Plans", href: "/admin/course-plans", permission: Permissions.COURSE_PLAN_MANAGE },
{ title: "Electives", href: "/admin/elective", permission: Permissions.ELECTIVE_MANAGE },
{ title: "admin.coursePlans", href: "/admin/course-plans", permission: Permissions.COURSE_PLAN_MANAGE },
{ title: "admin.electives", href: "/admin/elective", permission: Permissions.ELECTIVE_MANAGE },
]
},
{
title: "Scheduling",
title: "admin.scheduling",
icon: CalendarClock,
href: "/admin/scheduling/rules",
permission: Permissions.SCHEDULE_ADJUST,
items: [
{ title: "Rules", href: "/admin/scheduling/rules", permission: Permissions.SCHEDULE_ADJUST },
{ title: "Auto Schedule", href: "/admin/scheduling/auto", permission: Permissions.SCHEDULE_AUTO },
{ title: "Change Requests", href: "/admin/scheduling/changes", permission: Permissions.SCHEDULE_ADJUST },
{ title: "admin.rules", href: "/admin/scheduling/rules", permission: Permissions.SCHEDULE_ADJUST },
{ title: "admin.autoSchedule", href: "/admin/scheduling/auto", permission: Permissions.SCHEDULE_AUTO },
{ title: "admin.changeRequests", href: "/admin/scheduling/changes", permission: Permissions.SCHEDULE_ADJUST },
]
},
{
title: "Attendance",
title: "admin.attendance",
icon: CalendarCheck,
href: "/admin/attendance",
permission: Permissions.ATTENDANCE_READ,
},
{
title: "Announcements",
title: "admin.announcements",
icon: Megaphone,
href: "/admin/announcements",
permission: Permissions.ANNOUNCEMENT_MANAGE,
},
{
title: "文件管理",
title: "admin.files",
icon: Files,
href: "/admin/files",
permission: Permissions.FILE_READ,
},
{
title: "错题分析",
title: "admin.errorBook",
icon: BookX,
href: "/admin/error-book",
permission: Permissions.ERROR_BOOK_ANALYTICS_READ,
},
{
title: "课案管理",
title: "admin.lessonPlans",
icon: PenTool,
href: "/admin/lesson-plans",
permission: Permissions.LESSON_PLAN_READ,
},
{
title: "Audit Logs",
title: "admin.auditLogs",
icon: ScrollText,
href: "/admin/audit-logs",
permission: Permissions.AUDIT_LOG_READ,
items: [
{ title: "Operation Logs", href: "/admin/audit-logs" },
{ title: "Login Logs", href: "/admin/audit-logs/login-logs" },
{ title: "Data Changes", href: "/admin/audit-logs/data-changes" },
{ title: "admin.operationLogs", href: "/admin/audit-logs" },
{ title: "admin.loginLogs", href: "/admin/audit-logs/login-logs" },
{ title: "admin.dataChanges", href: "/admin/audit-logs/data-changes" },
]
},
...COMMON_NAV_ITEMS,
{
title: "AI 配置",
icon: Sparkles,
href: "/admin/ai-settings",
permission: Permissions.AI_CONFIGURE,
},
{
title: "Settings",
title: "admin.settings",
icon: Settings,
href: "/admin/settings",
permission: Permissions.SETTINGS_ADMIN,
@@ -168,165 +169,165 @@ export const NAV_CONFIG: Partial<Record<Role, NavItem[]>> = {
],
teacher: [
{
title: "仪表盘",
title: "teacher.dashboard",
icon: LayoutDashboard,
href: "/teacher/dashboard",
},
{
title: "教材",
title: "teacher.textbooks",
icon: Library,
href: "/teacher/textbooks",
permission: Permissions.TEXTBOOK_READ,
},
{
title: "考试",
title: "teacher.exams",
icon: FileQuestion,
href: "/teacher/exams",
permission: Permissions.EXAM_CREATE,
items: [
{ title: "全部考试", href: "/teacher/exams/all" },
{ title: "创建考试", href: "/teacher/exams/create", permission: Permissions.EXAM_CREATE },
{ title: "teacher.allExams", href: "/teacher/exams/all" },
{ title: "teacher.createExam", href: "/teacher/exams/create", permission: Permissions.EXAM_CREATE },
]
},
{
title: "作业",
title: "teacher.homework",
icon: PenTool,
href: "/teacher/homework",
permission: Permissions.HOMEWORK_CREATE,
items: [
{ title: "作业列表", href: "/teacher/homework/assignments" },
{ title: "提交记录", href: "/teacher/homework/submissions" },
{ title: "teacher.homeworkList", href: "/teacher/homework/assignments" },
{ title: "teacher.submissions", href: "/teacher/homework/submissions" },
]
},
{
title: "成绩",
title: "teacher.grades",
icon: GraduationCap,
href: "/teacher/grades",
permission: Permissions.GRADE_RECORD_MANAGE,
items: [
{ title: "全部成绩", href: "/teacher/grades" },
{ title: "批量录入", href: "/teacher/grades/entry", permission: Permissions.GRADE_RECORD_MANAGE },
{ title: "成绩统计", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "成绩分析", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.allGrades", href: "/teacher/grades" },
{ title: "teacher.batchEntry", href: "/teacher/grades/entry", permission: Permissions.GRADE_RECORD_MANAGE },
{ title: "teacher.gradeStats", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.gradeAnalytics", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
]
},
{
title: "题库",
title: "teacher.questions",
icon: ClipboardList,
href: "/teacher/questions",
permission: Permissions.QUESTION_READ,
},
{
title: "班级管理",
title: "teacher.classManagement",
icon: Users,
href: "/teacher/classes",
permission: Permissions.CLASS_READ,
items: [
{ title: "我的班级", href: "/teacher/classes/my" },
{ title: "学生", href: "/teacher/classes/students" },
{ title: "课表", href: "/teacher/classes/schedule", permission: Permissions.CLASS_SCHEDULE },
{ title: "teacher.myClasses", href: "/teacher/classes/my" },
{ title: "teacher.students", href: "/teacher/classes/students" },
{ title: "teacher.schedule", href: "/teacher/classes/schedule", permission: Permissions.CLASS_SCHEDULE },
]
},
{
title: "课程计划",
title: "teacher.coursePlans",
icon: CalendarRange,
href: "/teacher/course-plans",
permission: Permissions.COURSE_PLAN_READ,
},
{
title: "我的备课",
title: "teacher.lessonPlans",
icon: PenTool,
href: "/teacher/lesson-plans",
permission: Permissions.LESSON_PLAN_READ,
},
{
title: "考勤",
title: "teacher.attendance",
icon: CalendarCheck,
href: "/teacher/attendance",
permission: Permissions.ATTENDANCE_MANAGE,
items: [
{ title: "考勤记录", href: "/teacher/attendance" },
{ title: "录入考勤", href: "/teacher/attendance/sheet", permission: Permissions.ATTENDANCE_MANAGE },
{ title: "考勤统计", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
{ title: "teacher.attendanceRecords", href: "/teacher/attendance" },
{ title: "teacher.attendanceEntry", href: "/teacher/attendance/sheet", permission: Permissions.ATTENDANCE_MANAGE },
{ title: "teacher.attendanceStats", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
]
},
{
title: "调课申请",
title: "teacher.scheduleChanges",
icon: CalendarClock,
href: "/teacher/schedule-changes",
permission: Permissions.SCHEDULE_ADJUST,
},
{
title: "学情诊断",
title: "teacher.diagnostic",
icon: Stethoscope,
href: "/teacher/diagnostic",
permission: Permissions.DIAGNOSTIC_READ,
},
{
title: "错题分析",
title: "teacher.errorBook",
icon: BookX,
href: "/teacher/error-book",
permission: Permissions.ERROR_BOOK_ANALYTICS_READ,
},
{
title: "选修课",
title: "teacher.electives",
icon: BookMarked,
href: "/teacher/elective",
permission: Permissions.ELECTIVE_MANAGE,
},
{
title: "年级管理",
title: "teacher.gradeManagement",
icon: Briefcase,
href: "/management",
permission: Permissions.GRADE_MANAGE,
items: [
{ title: "年级班级", href: "/management/grade/classes" },
{ title: "年级仪表盘", href: "/management/grade/dashboard" },
{ title: "年级洞察", href: "/management/grade/insights" },
{ title: "teacher.gradeClasses", href: "/management/grade/classes" },
{ title: "teacher.gradeDashboard", href: "/management/grade/dashboard" },
{ title: "teacher.gradeInsights", href: "/management/grade/insights" },
]
},
...COMMON_NAV_ITEMS,
],
grade_head: [
{
title: "仪表盘",
title: "teacher.dashboard",
icon: LayoutDashboard,
href: "/management",
permission: Permissions.GRADE_MANAGE,
},
{
title: "年级管理",
title: "teacher.gradeManagement",
icon: Briefcase,
href: "/management",
permission: Permissions.GRADE_MANAGE,
items: [
{ title: "年级班级", href: "/management/grade/classes" },
{ title: "年级仪表盘", href: "/management/grade/dashboard" },
{ title: "年级洞察", href: "/management/grade/insights" },
{ title: "teacher.gradeClasses", href: "/management/grade/classes" },
{ title: "teacher.gradeDashboard", href: "/management/grade/dashboard" },
{ title: "teacher.gradeInsights", href: "/management/grade/insights" },
]
},
{
title: "考勤",
title: "teacher.attendance",
icon: CalendarCheck,
href: "/teacher/attendance",
permission: Permissions.ATTENDANCE_READ,
items: [
{ title: "考勤记录", href: "/teacher/attendance" },
{ title: "考勤统计", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
{ title: "teacher.attendanceRecords", href: "/teacher/attendance" },
{ title: "teacher.attendanceStats", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
]
},
{
title: "成绩",
title: "teacher.grades",
icon: GraduationCap,
href: "/teacher/grades",
permission: Permissions.GRADE_RECORD_READ,
items: [
{ title: "成绩统计", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "成绩分析", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.gradeStats", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.gradeAnalytics", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
]
},
{
title: "错题分析",
title: "teacher.errorBook",
icon: BookX,
href: "/teacher/error-book",
permission: Permissions.ERROR_BOOK_ANALYTICS_READ,
@@ -335,44 +336,44 @@ export const NAV_CONFIG: Partial<Record<Role, NavItem[]>> = {
],
teaching_head: [
{
title: "仪表盘",
title: "teacher.dashboard",
icon: LayoutDashboard,
href: "/management",
permission: Permissions.GRADE_MANAGE,
},
{
title: "年级管理",
title: "teacher.gradeManagement",
icon: Briefcase,
href: "/management",
permission: Permissions.GRADE_MANAGE,
items: [
{ title: "年级班级", href: "/management/grade/classes" },
{ title: "年级仪表盘", href: "/management/grade/dashboard" },
{ title: "年级洞察", href: "/management/grade/insights" },
{ title: "teacher.gradeClasses", href: "/management/grade/classes" },
{ title: "teacher.gradeDashboard", href: "/management/grade/dashboard" },
{ title: "teacher.gradeInsights", href: "/management/grade/insights" },
]
},
{
title: "考勤",
title: "teacher.attendance",
icon: CalendarCheck,
href: "/teacher/attendance",
permission: Permissions.ATTENDANCE_READ,
items: [
{ title: "考勤记录", href: "/teacher/attendance" },
{ title: "考勤统计", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
{ title: "teacher.attendanceRecords", href: "/teacher/attendance" },
{ title: "teacher.attendanceStats", href: "/teacher/attendance/stats", permission: Permissions.ATTENDANCE_READ },
]
},
{
title: "成绩",
title: "teacher.grades",
icon: GraduationCap,
href: "/teacher/grades",
permission: Permissions.GRADE_RECORD_READ,
items: [
{ title: "成绩统计", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "成绩分析", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.gradeStats", href: "/teacher/grades/stats", permission: Permissions.GRADE_RECORD_READ },
{ title: "teacher.gradeAnalytics", href: "/teacher/grades/analytics", permission: Permissions.GRADE_RECORD_READ },
]
},
{
title: "错题分析",
title: "teacher.errorBook",
icon: BookX,
href: "/teacher/error-book",
permission: Permissions.ERROR_BOOK_ANALYTICS_READ,
@@ -381,59 +382,59 @@ export const NAV_CONFIG: Partial<Record<Role, NavItem[]>> = {
],
student: [
{
title: "Dashboard",
title: "student.dashboard",
icon: LayoutDashboard,
href: "/student/dashboard",
},
{
title: "My Learning",
title: "student.myLearning",
icon: BookOpen,
href: "/student/learning",
permission: Permissions.HOMEWORK_SUBMIT,
items: [
{ title: "Courses", href: "/student/learning/courses" },
{ title: "Assignments", href: "/student/learning/assignments", permission: Permissions.HOMEWORK_SUBMIT },
{ title: "Textbooks", href: "/student/learning/textbooks", permission: Permissions.TEXTBOOK_READ },
{ title: "student.courses", href: "/student/learning/courses" },
{ title: "student.assignments", href: "/student/learning/assignments", permission: Permissions.HOMEWORK_SUBMIT },
{ title: "student.textbooks", href: "/student/learning/textbooks", permission: Permissions.TEXTBOOK_READ },
]
},
{
title: "Schedule",
title: "student.schedule",
icon: Calendar,
href: "/student/schedule",
permission: Permissions.CLASS_SCHEDULE,
},
{
title: "My Grades",
title: "student.myGrades",
icon: GraduationCap,
href: "/student/grades",
permission: Permissions.GRADE_RECORD_READ,
},
{
title: "我的课案",
title: "student.lessonPlans",
icon: PenTool,
href: "/student/lesson-plans",
permission: Permissions.LESSON_PLAN_READ,
},
{
title: "Attendance",
title: "student.attendance",
icon: CalendarCheck,
href: "/student/attendance",
permission: Permissions.ATTENDANCE_READ,
},
{
title: "Diagnostic",
title: "student.diagnostic",
icon: Stethoscope,
href: "/student/diagnostic",
permission: Permissions.DIAGNOSTIC_READ,
},
{
title: "错题本",
title: "student.errorBook",
icon: BookX,
href: "/student/error-book",
permission: Permissions.ERROR_BOOK_READ,
},
{
title: "Electives",
title: "student.electives",
icon: BookMarked,
href: "/student/elective",
permission: Permissions.ELECTIVE_SELECT,
@@ -442,36 +443,36 @@ export const NAV_CONFIG: Partial<Record<Role, NavItem[]>> = {
],
parent: [
{
title: "Dashboard",
title: "parent.dashboard",
icon: LayoutDashboard,
href: "/parent/dashboard",
},
{
title: "Grades",
title: "parent.grades",
icon: GraduationCap,
href: "/parent/grades",
permission: Permissions.GRADE_RECORD_READ,
},
{
title: "孩子课案",
title: "parent.lessonPlans",
icon: PenTool,
href: "/parent/lesson-plans",
permission: Permissions.LESSON_PLAN_READ,
},
{
title: "Attendance",
title: "parent.attendance",
icon: CalendarCheck,
href: "/parent/attendance",
permission: Permissions.ATTENDANCE_READ,
},
{
title: "错题本",
title: "parent.errorBook",
icon: BookX,
href: "/parent/error-book",
permission: Permissions.ERROR_BOOK_READ,
},
{
title: "Leave Request",
title: "parent.leaveRequest",
icon: CalendarRange,
href: "/parent/leave",
},