import { Inbox } from "lucide-react" import { getStudentClasses, getStudentSchedule } from "@/modules/classes/data-access" import { getDemoStudentUser } from "@/modules/homework/data-access" import { StudentScheduleFilters } from "@/modules/student/components/student-schedule-filters" import { StudentScheduleView } from "@/modules/student/components/student-schedule-view" import { EmptyState } from "@/shared/components/ui/empty-state" export const dynamic = "force-dynamic" type SearchParams = { [key: string]: string | string[] | undefined } export default async function StudentSchedulePage({ searchParams, }: { searchParams: Promise }) { const student = await getDemoStudentUser() if (!student) { return (

Schedule

Your weekly timetable.

) } const [sp, classes, schedule] = await Promise.all([ searchParams, getStudentClasses(student.id), getStudentSchedule(student.id), ]) const classIdParam = sp.classId const classId = typeof classIdParam === "string" ? classIdParam : Array.isArray(classIdParam) ? classIdParam[0] : "all" const filteredItems = classId && classId !== "all" ? schedule.filter((s) => s.classId === classId) : schedule return (

Schedule

Your weekly timetable.

) }