<template>
    <mx-tag-button text="纠错" icon="info-circle" @click="openCorrectPopup"/>
</template>

<script setup>
import {computed} from 'vue'
import {createPropDefine} from "@/utils";
import {useSingletonCorrectQuestion} from "@/hooks/useSingletonComponent";

const props = defineProps({
    question: createPropDefine({}, Object)
})
const emits = defineEmits(['change'])

const id = computed(() => props.question.questionId || props.question.id)

const openCorrectPopup = () => {
    if (!id.value) return
    const correctPopup = useSingletonCorrectQuestion()
    correctPopup.open(props.question)
}
</script>

<style scoped>

</style>