export const handleCanvasCursors = (name: string) => {
  const canvas = document.getElementById('work-space-three-d-canvas');
  if (!canvas) return;

  const cursorMap: Record<string, string> = {
    default: '',
    'draw-wall': 'draw',
    'draw-aisle': 'draw',
    'draw-zone': 'draw',
    'draw-floor': 'draw',
    measure: 'measure',
    delete: 'pointer',
    pointer: 'pointer',
    grab: 'hand',
    grabbing: 'hand-closed',
    pen: 'pen',
    'free-hand': 'hand',
    move: 'move',
    comment: 'comment',
    // Add more mappings as needed
  };

  const validCursorClasses = new Set(Object.values(cursorMap));

  // Remove previously applied cursor-related classes
  canvas.classList.forEach((cls) => {
    if (validCursorClasses.has(cls)) {
      canvas.classList.remove(cls);
    }
  });

  // Add the new cursor class
  const newCursorClass = cursorMap[name];
  if (newCursorClass) {
    canvas.classList.add(newCursorClass);
  }
};
