<script setup lang="ts">
import { useDashboardStore } from "@/stores/dashboard";
import { onMounted } from "vue";
import LoadingSpinner from "@/components/ui/LoadingSpinner.vue";

const dashboardStore = useDashboardStore();
onMounted(dashboardStore.loadDashboardDetails);
</script>

<template>
  <div class="bg-gray-200">
    <div v-if="dashboardStore.loading" class="m-8 flex justify-center">
      <LoadingSpinner />
    </div>
    <div v-else class="container-large flex flex-col space-y-8">
      <router-link class="btn-text inline-flex items-center pl-0" to="/">
        <it-icon-arrow-left />
        <span>{{ $t("general.back") }}</span>
      </router-link>
      <router-view></router-view>
    </div>
  </div>
</template>
