more permissive breadcrumbs

This commit is contained in:
2026-01-05 14:57:32 -07:00
parent b5899c02e4
commit 678727c650

View File

@@ -10,17 +10,15 @@ export const BreadCrumbs = () => {
const pathSegments = pathname?.split("/").filter(Boolean) || [];
const isCourseRoute = pathSegments[0] === "course";
const isOnCoursePage = isCourseRoute && pathSegments.length === 2;
const courseName =
isCourseRoute && !isOnCoursePage && pathSegments[1]
isCourseRoute && pathSegments[1]
? decodeURIComponent(pathSegments[1])
: null;
const isLectureRoute = isCourseRoute && pathSegments[2] === "lecture";
const isOnLecturePage = isLectureRoute && pathSegments.length === 4;
const lectureDate =
isLectureRoute && !isOnLecturePage && pathSegments[3]
isLectureRoute && pathSegments[3]
? decodeURIComponent(pathSegments[3])
: null;