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

export function success(message) {
  ElMessage({
    type:'success',
    message: message
  })
}

export function error(message) {
  ElMessage({
    type: 'error',
    message: message
  })
}

export function openElWarnMessage(message) {
  ElMessage({
    type: 'warning',
    message: message
  })
}

export function info(message) {
  ElMessage({
    type: 'info',
    message: message
  })
}

export function confirm(message, title = '提示', type = 'warning', callback) {
  ElMessageBox.confirm(message, title, {
    type: type,
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    callback: callback
  })
}

export function openElMessageBox(text, title) {
    ElMessageBox.alert(text, title, {
        confirmButtonText: 'OK',
        callback: () => {}
    })
}

export function openElMessage(text) {
    ElMessage(text)
}