<template>
    <div class="question-list">
        <el-collapse class="question-collapse" accordion>
            <el-collapse-item
                v-for="(question, index) in questions"
                :key="index"
                :title="question.title"
                :name="String(index)"
            >
                <markdown-renderer :content="question.content || ''" />
            </el-collapse-item>
        </el-collapse>
    </div>
</template>

<script setup lang="ts">
defineProps({
    questions: {
        type: Array as () => Array<{ title: string; content: string }>,
        default: () => []
    }
})
</script>

<style scoped>
.question-list {
    width: 100%;
}

.question-collapse {
    border: none;
}

.question-collapse :deep(.el-collapse-item__header) {
    font-size: 1rem;
    padding: 1rem;
}

.question-collapse :deep(.el-collapse-item) {
    margin-bottom: 1rem;
    border: 1px solid var(--el-border-color-light);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}
</style>