From 8e5c6debff3a2e53684f92ad770bd14957efb1e8 Mon Sep 17 00:00:00 2001 From: Divyateja Pasupuleti Date: Sat, 6 Apr 2024 16:45:00 +0530 Subject: [PATCH] feat: add changes to admin page --- frontend/app/admin/home/page.tsx | 83 +++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/frontend/app/admin/home/page.tsx b/frontend/app/admin/home/page.tsx index 9293251f..6f9afbf9 100644 --- a/frontend/app/admin/home/page.tsx +++ b/frontend/app/admin/home/page.tsx @@ -7,6 +7,8 @@ import { User } from '@/types' import { Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from '@nextui-org/table' import { siteConfig } from "@/config/site"; import { title } from "@/components/primitives"; +import { Card, CardBody } from "@nextui-org/card"; +import { FlagIcon, UserCircleIcon } from "@heroicons/react/24/solid"; axios.defaults.withCredentials = true; @@ -63,8 +65,85 @@ const AdminHomepage = () => {

Admin Home

- {error &&

{error}

} +
+ + {/* Users Card */} + + +
+ +
+ Number of Users +
+
+
+ {users.length} +
+ +
+
+
+ {users.filter(user => user.role == "user").length} +
+ Default +
+
+
+ {users.filter(user => user.role == "admin").length} +
+ Admins +
+
+
+ {users.filter(user => user.role == "banned").length} +
+ Banned +
+
+ +
+
+ + {/* Reports Card */} + + +
+ +
+ Number of Reports +
+
+
+ {users.length} +
+
+
+
+ {users.filter(user => user.role == "user").length} +
+ Pending +
+
+
+ {users.filter(user => user.role == "admin").length} +
+ Completed +
+
+
+ {users.filter(user => user.role == "banned").length} +
+ Irrelevant +
+
+
+
+ +
+ + {/* User Summary */} + {error &&

{error}

}
@@ -93,7 +172,7 @@ const AdminHomepage = () => {
-
+ ) }