<script setup lang="ts">
import * as log from "loglevel";

import SelfEvaluation from "@/components/learningPath/SelfEvaluation.vue";
import { computed } from "vue";
import { useCourseDataWithCompletion } from "@/composables";

log.debug("LearningUnitSelfEvaluationView created");

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

const courseData = useCourseDataWithCompletion(props.courseSlug);
const learningUnit = computed(() => {
  return courseData.findLearningUnit(props.learningUnitSlug, props.circleSlug);
});
const circle = computed(() => {
  return courseData.findCircle(props.circleSlug);
});
</script>

<template>
  <SelfEvaluation
    v-if="learningUnit && circle"
    :learning-unit="learningUnit"
    :circle="circle"
  />
</template>

<style lang="postcss" scoped></style>
