<template>
  <div class="main">
    <user-profile />
    <div class="lines">
      <van-cell-group>
        <van-cell title="消息通知" is-link to="/tongzhi">
          <template #value>
            <van-badge max="99" :show-zero="false" position="" :content="unread_tongzhi_count"/>
          </template>
        </van-cell>
      </van-cell-group>
    </div>
    <div class="lines">
      <van-cell-group>
        <van-cell title="我的学生" is-link to="/teacher/students"></van-cell>
      </van-cell-group>
    </div>
    <div class="lines" v-if="supervisor">
      <van-cell-group>
        <van-cell title="我的主管老师" :value="supervisor.teacher_name"></van-cell>
      </van-cell-group>
    </div>
    <div class="lines">
      <van-cell-group>
        <van-cell title="我的小组" is-link to="/user-group"></van-cell>
      </van-cell-group>
    </div>
    <div class="lines">
      <van-cell-group>
        <van-cell title="切换机构" is-link to="/org/select"></van-cell>
        <van-cell title="机构首页管理" is-link to="/org/homepage"></van-cell>
        <van-cell title="个性化设置" is-link to="/user-settings"></van-cell>
      </van-cell-group>
    </div>
  </div>
</template>

<script lang="ts">
import {defineComponent, computed} from 'vue'
import { CellGroup, Cell, Badge} from 'vant'
import UserProfile from '~/components/user-profile.vue'
import useUser from '~/store/user'

export default defineComponent({
  name: "teacher-profile",
  components: {
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
    [Badge.name]: Badge,
    [UserProfile.name]: UserProfile
  },
  setup(){
    
    const {store} = useUser()

    const unread_tongzhi_count = computed(() => store.current.unread_tongzhi_count)

    const supervisor = computed(() => store.current.supervisor)

    return {unread_tongzhi_count, supervisor}
  }

})
</script>

<style scoped lang="less">
.main {


}
</style>
