<script setup lang="ts">
import { useCompetenceStore } from "@/stores/competence";
import * as log from "loglevel";
import { onMounted } from "vue";

log.debug("CompetenceParentPage created");

const props = defineProps<{
  courseSlug: string;
}>();

const competenceStore = useCompetenceStore();

onMounted(async () => {
  log.debug("CompetenceParentPage mounted", props.courseSlug);

  try {
    const competencePageSlug = props.courseSlug + "-competence";
    await competenceStore.loadCompetenceProfilePage(competencePageSlug);
  } catch (error) {
    log.error(error);
  }
});
</script>

<template>
  <div class="bg-gray-200">
    <main>
      <router-view></router-view>
    </main>
  </div>
</template>

<style scoped></style>
