<template>
  <Modal :show="show" title="Bitte warten">
    <div class="loading-wrapper">
      <div class="spinner"></div>
      <p>{{ message }}</p>
    </div>
  </Modal>
</template>

<script setup>
import Modal from './Modal.vue'

const props = defineProps({
  show: Boolean,
  message: {
    type: String,
    default: "Bitte warte während die Anfrage bearbeitet wird ..."
  }
})
</script>

<style scoped>
.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 1rem;
  text-align: center;
}

/* klassischer Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #ddd;
  border-top-color: #47a0d8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

p {
  margin: 0;
  font-size: 14px;
  color: #555;
}
</style>
