feat(student): 完成 student 模块 v4 剩余修复
- P1-4.2: 新增班级详情页 courses/[classId],展示教师/学校/教室信息与课表 - P2-2.5: 今日课表卡片高亮当前/下一节课(useMemo 实时计算) - P2-3.9: 作业作答进度网格支持点击跳转题目(scrollIntoView) - P2-3.10: 作业复习视图显示正确答案(选择/判断/文本题) - P2-4.4: 课程列表支持按班级名/教师/学校搜索 - P2-5.2: 成绩页新增趋势折线图组件 GradeTrendCard - P2-9.2/9.3: 诊断报告新增历史记录卡片与弱点练习入口 - P2-10.2: 选课列表支持搜索与选课模式筛选 - P2-11.3: 修复教材阅读页全屏溢出 - P3-1.5: 面包屑保留首个角色段作为根上下文 - P3-7.3: 课表项支持点击跳转至班级详情页(ScheduleList href)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import type { ReactNode } from "react"
|
||||
import Link from "next/link"
|
||||
import { Clock, MapPin } from "lucide-react"
|
||||
|
||||
import { Badge } from "@/shared/components/ui/badge"
|
||||
@@ -23,6 +24,8 @@ export interface ScheduleListItemData {
|
||||
endTime: string
|
||||
location?: string | null
|
||||
className?: string
|
||||
/** Optional href to navigate to when the item is clicked */
|
||||
href?: string
|
||||
}
|
||||
|
||||
interface ScheduleListItemProps {
|
||||
@@ -46,8 +49,8 @@ export function ScheduleListItem({
|
||||
? "flex items-center justify-between border-b pb-4 last:border-0 last:pb-0"
|
||||
: "flex items-start justify-between gap-3 rounded-md border bg-card p-3"
|
||||
|
||||
return (
|
||||
<div key={item.id} className={cn(wrapperClass, className)}>
|
||||
const content = (
|
||||
<>
|
||||
<div className="space-y-1 min-w-0">
|
||||
<div className="font-medium leading-none truncate">{item.course}</div>
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground">
|
||||
@@ -72,6 +75,23 @@ export function ScheduleListItem({
|
||||
{item.className}
|
||||
</Badge>
|
||||
) : null}
|
||||
</>
|
||||
)
|
||||
|
||||
if (item.href) {
|
||||
return (
|
||||
<Link
|
||||
href={item.href}
|
||||
className={cn(wrapperClass, className, "transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring")}
|
||||
>
|
||||
{content}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn(wrapperClass, className)}>
|
||||
{content}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user