moving v2 to top level

This commit is contained in:
2024-12-17 09:19:21 -07:00
parent 5f0b3554dc
commit 576ee02afb
468 changed files with 79 additions and 15430 deletions

View File

@@ -0,0 +1,24 @@
"use client";
import { IModuleItem } from "@/models/local/IModuleItem";
import { createContext, useContext, DragEvent } from "react";
export interface DraggableItem {
item: IModuleItem;
sourceModuleName: string | undefined; // undefined for lectures
type: "quiz" | "assignment" | "page" | "lecture";
}
export interface DraggingContextInterface {
itemDropOnDay: (e: DragEvent, droppedOnDay: string) => void;
itemDropOnModule: (e: DragEvent, moduleName: string) => void;
}
const defaultDraggingValue: DraggingContextInterface = {
itemDropOnDay: () => {},
itemDropOnModule: () => {},
};
export const DraggingContext =
createContext<DraggingContextInterface>(defaultDraggingValue);
export function useDraggingContext() {
return useContext(DraggingContext);
}