import { Tag, Typography } from 'antd' import { wrongQuestionApi } from '../api/client' import type { WrongQuestion } from '../types' import { STATUS_LABELS } from '../types' import WrongQuestionDetail from '../pages/WrongQuestionDetail' interface Props { items: WrongQuestion[] selectedId: string | null onSelect: (id: string | null) => void onRefresh: () => void emptyText?: string } export default function WrongQuestionList({ items, selectedId, onSelect, onRefresh, emptyText = '暂无记录', }: Props) { return ( <>
{items.map((wq) => (
onSelect(wq.id)}> 题目
{wq.subject_name} {wq.category === 'olympiad' && ( 奥数 )} {STATUS_LABELS[wq.status]} {wq.question_text || wq.ocr_raw_text || '处理中…'}
))}
{items.length === 0 && {emptyText}} {selectedId && ( onSelect(null)} onUpdated={onRefresh} /> )} ) }