// 切换 Alert 显示/隐藏
export function toggleAlert(showAlert, setShowAlert) {
  setShowAlert(!showAlert)
}

// 关闭 Alert
export function closeAlert(setShowAlert) {
  setShowAlert(false)
}

// 创建切换处理函数
export function createHandleToggle(showAlert, setShowAlert) {
  return () => {
    toggleAlert(showAlert, setShowAlert)
  }
}

// 创建关闭处理函数
export function createHandleClose(setShowAlert) {
  return () => {
    closeAlert(setShowAlert)
  }
}
