()
| 10 | } |
| 11 | |
| 12 | const AdminMCQ = () => { |
| 13 | const [Problems, setProblems] = useState<AdminAddMCQProps[]>([]); |
| 14 | useEffect(() => { |
| 15 | async function fetchMCQs() { |
| 16 | const Problems = await getAllMCQs(); |
| 17 | setProblems(Problems); |
| 18 | } |
| 19 | fetchMCQs(); |
| 20 | }, []); |
| 21 | return ( |
| 22 | <div className="flex justify-center"> |
| 23 | <div className="w-2/3 space-y-4 mt-5"> |
| 24 | {Problems.map((problem) => ( |
| 25 | <Card> |
| 26 | <CardHeader> |
| 27 | <div className="flex justify-between items-start"> |
| 28 | <div> |
| 29 | <CardTitle>{problem.id}</CardTitle> |
| 30 | <CardTitle>{problem.title}</CardTitle> |
| 31 | </div> |
| 32 | <div className="flex gap-4 items-center"> |
| 33 | <AdminAddMCQ problem={problem} /> |
| 34 | </div> |
| 35 | </div> |
| 36 | <CardDescription>{problem.description}</CardDescription> |
| 37 | <CardDescription>{problem.type}</CardDescription> |
| 38 | </CardHeader> |
| 39 | <CardContent>{problem.notionDocId}</CardContent> |
| 40 | </Card> |
| 41 | ))} |
| 42 | </div> |
| 43 | </div> |
| 44 | ); |
| 45 | }; |
| 46 | |
| 47 | export default AdminMCQ; |
nothing calls this directly
no test coverage detected