<template>
  <ModalDialog title="Warning!" @backdrop-click="$emit('cancel')">
    <div class="modal-message">
      {{ message }}
    </div>
    <div class="modal-actions">
      <button @click="$emit('confirm')" class="btn btn-primary">Yes</button>
      <button @click="$emit('cancel')" class="btn btn-secondary">No</button>
    </div>
  </ModalDialog>
</template>

<script setup lang="ts">
import ModalDialog from '../shared/ModalDialog.vue'

withDefaults(
  defineProps<{
    message?: string
  }>(),
  {
    message: 'A reward is currently pending. It will be cancelled. Would you like to proceed?',
  },
)

defineEmits<{
  confirm: []
  cancel: []
}>()
</script>

<style scoped>
.modal-message {
  margin-bottom: 1.2rem;
  font-size: 1rem;
  color: var(--modal-message-color, #333);
}
</style>
