10 lines
407 B
TypeScript
10 lines
407 B
TypeScript
import type { InteractionMode } from "@editor/tools";
|
|
import { isPanInteractionMode } from "@editor/tools";
|
|
import type { CanvasInputState } from "./useCanvasInput";
|
|
|
|
export function canvasCursorClass(interactionMode: InteractionMode, input: CanvasInputState) {
|
|
if (input.isPanning) return "cursor-grabbing";
|
|
if (isPanInteractionMode(interactionMode)) return "cursor-grab";
|
|
return "cursor-default";
|
|
}
|