diff --git a/src/app/date/[date]/page.tsx b/src/app/date/[date]/page.tsx index 4add794..f5dc117 100644 --- a/src/app/date/[date]/page.tsx +++ b/src/app/date/[date]/page.tsx @@ -1,4 +1,4 @@ -import { groupEventsByLine } from "@/common/utils"; +import { groupEventsByLine, groupEventsByStartTime } from "@/common/utils"; import { EventCard } from "@/components/EventCard"; import { EventList } from "@/components/EventList"; import { Button } from "@/components/ui/button"; @@ -11,6 +11,7 @@ import { SelectValue, } from "@/components/ui/select"; import { getAllLines, getEventsForDate } from "@/db"; +import { line } from "drizzle-orm/pg-core"; import { notFound } from "next/navigation"; export default async function ScheduleByDate({ @@ -35,11 +36,12 @@ export default async function ScheduleByDate({ if (events.length === 0) { return notFound(); } - const groupedEvents = groupEventsByLine(events); + const eventsByLine = groupEventsByLine(events); + const eventsByTime = groupEventsByStartTime(events); const allLines = await getAllLines(); return ( -
-
+
+

{parsedDate.toLocaleDateString(["cs-CZ"], { weekday: "long", @@ -71,14 +73,25 @@ export default async function ScheduleByDate({

{group === "line" && - groupedEvents.map((line) => ( + eventsByLine.map((line) => ( l.id === line.lineId)?.name} /> ))} - {group !== "line" && } + {group !== "line" && + eventsByTime.map((time) => ( + + ))}
); diff --git a/src/app/favorites/page.tsx b/src/app/favorites/page.tsx index ded8fe8..69d2ad5 100644 --- a/src/app/favorites/page.tsx +++ b/src/app/favorites/page.tsx @@ -23,8 +23,8 @@ export default async function FavoritesPage({ }); return ( -
-
+
+

Oblíbené

diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 51f38be..5139d5c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -38,7 +38,7 @@ export default async function RootLayout({ -
+
diff --git a/src/app/line/[line]/page.tsx b/src/app/line/[line]/page.tsx index c771b75..461681d 100644 --- a/src/app/line/[line]/page.tsx +++ b/src/app/line/[line]/page.tsx @@ -23,7 +23,7 @@ export default async function ScheduleByLine({ const lineData = groupEventsByDate(events); return ( -
+

{lineInfo.name}

{lineInfo.description}
diff --git a/src/app/now/page.tsx b/src/app/now/page.tsx index 853f79b..bd9debe 100644 --- a/src/app/now/page.tsx +++ b/src/app/now/page.tsx @@ -7,21 +7,23 @@ export default async function FavoritesPage() { const groupedEvents = groupEventsByStartTime(nowEvents); return ( -
-
+
+

Kam jít?

- {groupedEvents.map(({events, startTime}) => ( + {groupedEvents.map(({ events, startTime }) => (
-

- Od {new Date(startTime).toLocaleTimeString("cs-CZ", { + - + })}`} + events={events} + showDate + showLine + />

))}
diff --git a/src/app/page.tsx b/src/app/page.tsx index 12a8e98..bc693c7 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -13,7 +13,7 @@ export default async function Home({ searchParams }: HomePageProps) { console.log("Message from searchParams:", message); return ( -
+
{message && ( diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 949b529..d1fbb63 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -10,7 +10,7 @@ export default async function SearchPage({ searchParams }: SearchPageProps) { const query = (await searchParams).q || ""; const results = query ? await searchEvents(query) : []; return ( -
+

Výsledky hledání pro "{query}" diff --git a/src/components/EventList.tsx b/src/components/EventList.tsx index a6d3d5a..181b912 100644 --- a/src/components/EventList.tsx +++ b/src/components/EventList.tsx @@ -2,30 +2,34 @@ import type { Event } from "@/common/parser"; import { EventCard } from "./EventCard"; export function EventList({ - events, - title, - showDate, - showLine, + events, + title, + showDate, + showLine, }: { - events: Event[]; - title?: string; - showDate?: boolean; - showLine?: boolean; + events: Event[]; + title?: string; + showDate?: boolean; + showLine?: boolean; }) { - return ( -
- {title &&

{title}

} - {events.length === 0 && ( -

Žádné události.

- )} - {events.map((event) => ( - - ))} -
- ); -} \ No newline at end of file + return ( +
+ {title && ( +

+ {title} +

+ )} + {events.length === 0 &&

Žádné události.

} +
+ {events.map((event) => ( + + ))} +
+
+ ); +}