import { ref } from 'vue'

/**
 * 步骤控制逻辑
 */
export function useSteps() {
  const currentStep = ref(1)
  
  const nextStep = () => {
    currentStep.value = Math.min(3, currentStep.value + 1)
  }
  
  const prevStep = () => {
    currentStep.value = Math.max(1, currentStep.value - 1)
  }
  
  const resetStep = () => {
    currentStep.value = 1
  }
  
  const isStep = (step) => currentStep.value === step
  
  return {
    currentStep,
    nextStep,
    prevStep,
    resetStep,
    isStep
  }
}
