import { createSharedComposable } from '@vueuse/core'
import { ref } from 'vue'

export enum MarkingTool {
  SELECT = 'select',
  RECT = 'rect',
  TEXT = 'text',
  PEN = 'pen',
  CORRECT = 'correct',
  WRONG = 'wrong',
  HALF = 'half',
  ERASER = 'eraser',
}

/**
 * 简化的标记工具管理
 * 只负责工具状态，不管理具体的绘制逻辑
 */
export const useSimpleMarkingTool = createSharedComposable(() => {
  const currentTool = ref<MarkingTool>(MarkingTool.SELECT)

  const switchTool = (tool: MarkingTool) => {
    currentTool.value = tool
  }

  return {
    currentTool,
    switchTool,
    MarkingTool,
  }
})
