import { ElMessageBox, ElMessage } from 'element-plus'

/**
 * 确认操作对话框
 */
export function confirmAction(message: string, title: string = '确认操作'): Promise<boolean> {
  return ElMessageBox.confirm(message, title, {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
  })
    .then(() => true)
    .catch(() => false)
}

/**
 * 成功提示
 */
export function showSuccess(message: string) {
  ElMessage.success(message)
}

/**
 * 错误提示
 */
export function showError(message: string) {
  ElMessage.error(message)
}

/**
 * 警告提示
 */
export function showWarning(message: string) {
  ElMessage.warning(message)
}
