<template>
  <kk-button text @click="open">Click to open Message Box</kk-button>
</template>

<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { KkButton, KkMessageBox } from 'kankan-components'

const open = () => {
  KkMessageBox.confirm(
    'proxy will permanently delete the file. Continue?',
    'Warning',
    {
      confirmButtonText: 'OK',
      cancelButtonText: 'Cancel',
      type: 'warning',
      center: true,
    }
  )
    .then(() => {
      ElMessage({
        type: 'success',
        message: 'Delete completed',
      })
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: 'Delete canceled',
      })
    })
}
</script>
