<template>
  <view class="bg-white h-full">
    <knowledge-history-student v-if="isStudent" />
    <teacher-class-view v-else>
      <template #default="{ teachClass }">
        <knowledge-history-teacher :teach-class="teachClass" />
      </template>
    </teacher-class-view>
  </view>
</template>
<script lang="ts" setup>
defineOptions({
  options: {
    virtualHost: true
  }
});
import teacherClassView from '@/pagesStudy/components/teacher-class-view.vue';
import knowledgeHistoryStudent from './knowledge-history-student.vue';
import knowledgeHistoryTeacher from './knowledge-history-teacher.vue';
import { OPEN_KNOWLEDGE_DETAIL } from '@/types/injectionSymbols';
import { useTransferPage } from '@/hooks/useTransferPage';
import { useUserStore } from '@/store/userStore';
const { transferTo } = useTransferPage();
const { isStudent } = storeToRefs(useUserStore());

const openKnowledgeDetail = (id: number, name: string) => {
  transferTo('/pagesStudy/pages/study-knowledge-detail/study-knowledge-detail', {
    data: {
      recordId: id,
      name: name
    }
  });
}
provide(OPEN_KNOWLEDGE_DETAIL, openKnowledgeDetail);
</script>
<style lang="scss" scoped>
:deep(.custom-progress .uni-progress-bar) {
  @apply rounded-8;
}

:deep(.custom-progress .uni-progress-inner-bar) {
  @apply rounded-8;
}
</style>