<script setup lang="ts">
import { useGroup } from '../../../composables/useAllData'
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'

const role = inject('role') as string

defineProps<{ node: any }>()

const { groupList } = useGroup()

const answer = function (id: string) {
  return groupList.value.find(item => item.id === id)?.name || ''
}
</script>

<template>
  <ConfigViewTemplate :node="node">
    <div>
      <el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
      <el-form-item label="监控的群组" style="margin-left: 30px">{{
        answer(node.data?.student.group_id)
      }}</el-form-item>
    </div>
    <div>
      <el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
      <el-form-item label="监控的群组" style="margin-left: 30px">{{
        answer(node.data?.teacher.group_id)
      }}</el-form-item>
    </div>
  </ConfigViewTemplate>
</template>
