完整性更新

现在已经实现了大部分基础功能
This commit is contained in:
SpecialX
2026-01-08 11:14:03 +08:00
parent 0da2eac0b4
commit 57807def37
155 changed files with 26421 additions and 1036 deletions

View File

@@ -0,0 +1,73 @@
import Link from "next/link";
import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card";
import { Badge } from "@/shared/components/ui/badge";
import { Clock, MapPin, CalendarDays, CalendarX } from "lucide-react";
import { EmptyState } from "@/shared/components/ui/empty-state";
type TeacherTodayScheduleItem = {
id: string;
classId: string;
className: string;
course: string;
startTime: string;
endTime: string;
location: string | null;
};
export function TeacherSchedule({ items }: { items: TeacherTodayScheduleItem[] }) {
const hasSchedule = items.length > 0;
return (
<Card className="col-span-3">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<CalendarDays className="h-4 w-4 text-muted-foreground" />
Today&apos;s Schedule
</CardTitle>
</CardHeader>
<CardContent>
{!hasSchedule ? (
<EmptyState
icon={CalendarX}
title="No Classes Today"
description="No timetable entries for today."
action={{ label: "View schedule", href: "/teacher/classes/schedule" }}
className="border-none h-[300px]"
/>
) : (
<div className="space-y-4">
{items.map((item) => (
<div
key={item.id}
className="flex items-center justify-between border-b pb-4 last:border-0 last:pb-0"
>
<div className="space-y-1">
<Link
href={`/teacher/classes/schedule?classId=${encodeURIComponent(item.classId)}`}
className="font-medium leading-none hover:underline"
>
{item.course}
</Link>
<div className="flex items-center text-sm text-muted-foreground">
<Clock className="mr-1 h-3 w-3" />
<span className="mr-3">{item.startTime}{item.endTime}</span>
{item.location ? (
<>
<MapPin className="mr-1 h-3 w-3" />
<span>{item.location}</span>
</>
) : null}
</div>
</div>
<Badge variant="secondary">
{item.className}
</Badge>
</div>
))}
</div>
)}
</CardContent>
</Card>
);
}