<template>
  <cu-modal v-if="showConfirm">
    <template slot="body">
      <div v-html="confirmMessage" />
    </template>
    <template slot="footer">
      <cu-button
        type="primary"
        @click="handleOk"
      >
        {{ okText }}
      </cu-button>
      <cu-button
        type="secondary"
        @click="closeConfirm"
      >
        {{ cancelText }}
      </cu-button>
    </template>
  </cu-modal>
</template>

<script>
export default {
  name: 'CuConfirm',
  props: {
    showConfirm: {
      type: Boolean,
      default: false
    },
    confirmMessage: {
      type: String,
      default: ''
    },
    okText: {
      type: String,
      default: '확인'
    },
    cancelText: {
      type: String,
      default: '취소'
    }
  },
  methods: {
    handleOk (e) {
      this.$emit('click', e)
    },
    closeConfirm () {
      this.showConfirm = false
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
