got some server hydration I think

This commit is contained in:
2024-11-08 15:16:53 -07:00
parent 011c28f0fd
commit 6fd5053ac5
20 changed files with 568 additions and 244 deletions

View File

@@ -1,19 +1,21 @@
"use client";
import { useLecturesByWeekQuery } from "@/hooks/localCourse/lectureHooks";
import { getDateOnlyMarkdownString } from "@/models/local/timeUtils";
import { getLecturePreviewUrl } from "@/services/urlUtils";
import Link from "next/link";
import { useCourseContext } from "../course/[courseName]/context/courseContext";
import { getLectureForDay } from "@/models/local/lectureUtils";
import { trpc } from "@/services/trpc/utils";
export default function OneCourseLectures() {
const { courseName } = useCourseContext();
const { data: weeks } = useLecturesByWeekQuery();
// const { data: weeks } = useLecturesByWeekQuery();
const [weeks] = trpc.lectures.getLectures.useSuspenseQuery({ courseName });
const dayAsDate = new Date();
const dayAsString = getDateOnlyMarkdownString(dayAsDate);
const todaysLecture = getLectureForDay(weeks, dayAsDate);
if (!todaysLecture) return <></>;
return (
<Link