{
"data": {
"abnakore.near": {
"widget": {
"AdminHome.jsx": {
"": "// Pages that can be reached via the aside tab\nconst [pages, setPage] = useState([\n { name: \"Home\", link: \"/admin\" },\n { name: \"Manage Candidates\", link: \"/admin/manage_candidates\" },\n { name: \"Mange Parties\", link: \"/admin/manage_parties\" },\n]);\n\n// List of parties and their curresponding number of votes\nconst [parties, setParties] = useState([\n { id: 1, name: \"Foo\", acronym: \"FOO\" },\n { id: 2, name: \"Bar\", acronym: \"BAR\" },\n { id: 3, name: \"Baz\", acronym: \"BAZ\" },\n { id: 4, name: \"sass\", acronym: \"SAS\" },\n]);\n\n// List of candidates and their curresponding number of votes\nconst [candidates, setCandidates] = useState([\n {\n id: 1,\n name: \"Foo\",\n party: \"APD\",\n email: \"example@gmail.com\",\n role: \"President\",\n votes: 3,\n rank: 2,\n },\n {\n id: 2,\n name: \"Bar\",\n party: \"YMB\",\n email: \"example@gmail.com\",\n role: \"President\",\n votes: 5,\n rank: 1,\n },\n {\n id: 3,\n name: \"Baz\",\n party: \"AAN\",\n email: \"example@gmail.com\",\n role: \"President\",\n votes: 1,\n rank: 4,\n },\n {\n id: 4,\n name: \"sass\",\n party: \"AKA\",\n email: \"example@gmail.com\",\n role: \"President\",\n votes: 2,\n rank: 3,\n },\n]);\n\nreturn (\n <>\n <Widget\n src=\"abnakore.near/widget/Aside.jsx\"\n props={{ objs: pages, active: \"/admin\" }}\n />\n <h1>Admin Home</h1>\n <h4>Candidates Details</h4>\n <Widget\n src=\"abnakore.near/widget/Table.jsx\"\n props={{\n headings: [\n \"S/N\",\n \"Candidate's Name\",\n \"Party\",\n \"Email\",\n \"Role\",\n \"Number of votes\",\n \"Rank\",\n ],\n data: Object.values(candidates.map((c) => Object.values(c))),\n }}\n />\n <h4>Parties Details</h4>\n <Widget\n src=\"abnakore.near/widget/Table.jsx\"\n props={{\n headings: [\"S/N\", \"Party Name\", \"Acronym\"],\n data: Object.values(parties.map((c) => Object.values(c))),\n }}\n />\n </>\n);\n",
"metadata": {
"fork_of": "abnakore.near/widget/AdminHome.jsx@107707503"
}
}
}
}
}
}