import { groupEventsByDate } from "@/common/utils"; import { EventList } from "@/components/EventList"; import { getEventsForLine, getLineById } from "@/db"; import { notFound } from "next/navigation"; export default async function ScheduleByLine({ params, }: { params: Promise<{ line: string; }>; }) { const { line } = await params; const lineId = parseInt(line, 10); if (Number.isNaN(lineId)) { return notFound(); } const lineInfo = await getLineById(lineId); if (!lineInfo) { return notFound(); } const events = await getEventsForLine(lineId); const lineData = groupEventsByDate(events); return (

{lineInfo.name}

{lineInfo.description}
{lineData?.map((day) => ( ))}
); }