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

log.debug("CompetenceListPage created");

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

const competenceStore = useCompetenceStore();
</script>

<template>
  <div class="container-large">
    <h2 class="mb-4 lg:py-4">{{ $t("a.Handlungskompetenzen") }}</h2>

    <ul v-if="competenceStore.competenceProfilePage()">
      <li
        v-for="competence in competenceStore.competences()"
        :key="competence.id"
        class="mb-8 bg-white p-8"
      >
        <CompetenceDetail
          :competence="competence"
          :course-slug="props.courseSlug"
        ></CompetenceDetail>
      </li>
    </ul>
  </div>
</template>

<style scoped></style>
