MCPcopy Create free account
hub / github.com/code100x/daily-code / AdminMCQ

Function AdminMCQ

apps/web/components/admin/AdminMCQ.tsx:12–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12const 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
47export default AdminMCQ;

Callers

nothing calls this directly

Calls 1

fetchMCQsFunction · 0.70

Tested by

no test coverage detected