<template>
  <div class="modal-dialog__container">
    <DialogBox :title="title" :no-close-button="noCloseButton" @close="emit('close')">
      <slot />
      <template v-slot:footer>
        <slot name="footer" />
      </template>
    </DialogBox>
    <div class="modal-dialog__backdrop" />
  </div>
</template>

<script setup lang="ts">
defineProps<{
  title?: string
  noCloseButton?: boolean
}>()

const emit = defineEmits(['close'])
</script>

<style lang="scss">
@import '~/assets/css/components';

.modal-dialog {
  &__container {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }

  &__backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: $modal-dialog-backdrop-background-color;
    z-index: 10;
  }
}
</style>
