import { ElMessageBox } from 'element-plus'

export type messageType = '' | 'success' | 'warning' | 'info' | 'error'
export default function useHandleData(message: string, messageType: messageType = 'warning'): Promise<boolean> {
    return new Promise(resolve => {
        ElMessageBox.confirm(message, '温馨提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: messageType
        })
            .then(() => {
                resolve(true)
            })
            .catch(() => {
                resolve(false)
            })
    })
}
