<template>
  <div v-if="open" class="modal-backdrop" @click.self="$emit('close')">
    <div class="modal">
      <div class="modal-header">
        <strong>{{ title }}</strong>
        <button class="icon-btn" @click="$emit('close')">Cerrar</button>
      </div>
      <div>
        <slot />
      </div>
      <div class="modal-footer">
        <slot name="footer">
          <button class="icon-btn" @click="$emit('close')">OK</button>
        </slot>
      </div>
    </div>
  </div>
  </template>

<script setup>
defineProps({ open: Boolean, title: String });
defineEmits(['close']);
</script>

