<script setup lang="ts">
import BaseDialog from "./BaseDialog.vue";

defineProps<{ open: boolean; title: string; message: string; confirmLabel?: string; pending?: boolean }>();
const emit = defineEmits<{ close: []; confirm: [] }>();
</script>

<template>
  <BaseDialog :open="open" :title="title" :description="message" @close="emit('close')">
    <template #footer>
      <button class="table-action" type="button" :disabled="pending" @click="emit('close')">取消</button>
      <button class="table-action danger" type="button" :disabled="pending" @click="emit('confirm')">{{ pending ? "处理中" : confirmLabel || "确认" }}</button>
    </template>
  </BaseDialog>
</template>
