<script lang="ts" setup>
import {useNotificationStore} from "~/store/notification";

const notification = computed(() => useNotificationStore().notification);
const hasNotification = computed(() => useNotificationStore().hasNotification);
const type = computed(() => useNotificationStore().type);

</script>
<template>
  <main-header/>
  <main class="main-content">
    <slot/>
    <toaster v-if="hasNotification" :title="notification.message" :type="type">
      <ul v-if="notification.details && notification.details.isArray()">
        <li v-for="error in notification.details">{{ error }}</li>
      </ul>
    </toaster>
  </main>
  <main-footer/>
</template>
