mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 23:58:31 -06:00
add previous and next buttons (lectures are separate from assignments/quizzes/pages)
This commit is contained in:
14
src/app/course/[courseName]/hooks/useItemNavigation.ts
Normal file
14
src/app/course/[courseName]/hooks/useItemNavigation.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useOrderedCourseItems } from "./useOrderedCourseItems";
|
||||
import { getNavigationLinks, CourseItemType } from "./navigationLogic";
|
||||
|
||||
export function useItemNavigation(
|
||||
type: CourseItemType,
|
||||
name: string,
|
||||
moduleName?: string
|
||||
) {
|
||||
const { orderedItems, orderedLectures } = useOrderedCourseItems();
|
||||
|
||||
const list = type === "lecture" ? orderedLectures : orderedItems;
|
||||
|
||||
return getNavigationLinks(list, type, name, moduleName);
|
||||
}
|
||||
Reference in New Issue
Block a user