diff --git a/frontend/edu-connect/src/app/(admin)/admin/course/_partials/CourseTable.tsx b/frontend/edu-connect/src/app/(admin)/admin/course/_partials/CourseTable.tsx new file mode 100644 index 0000000..6d5e990 --- /dev/null +++ b/frontend/edu-connect/src/app/(admin)/admin/course/_partials/CourseTable.tsx @@ -0,0 +1,137 @@ +import DataTable from "@/components/(dashboard)/common/DataTable/DataTable" +import { Button } from "@/components/(dashboard)/ui/button" +import { Avatar, AvatarImage } from "@/components/ui/avatar" +import { Badge } from "@/components/ui/badge" +import { routes } from "@/lib/routes" +import { ColumnDef } from "@tanstack/react-table" +import { ArrowUpDown } from "lucide-react" +import Link from "next/link" + +const CourseTable :React.FC<{ + mutate : () => void + Data : Array + isLoading : boolean +}> = ({ + mutate , + Data , + isLoading +}) => { + + const columns: ColumnDef[] = [ + { + accessorKey: "sn", + header: "SN", + cell: ({ row }) => ( +
{row.index + 1}
+ ), + }, + { + id: 'name', + accessorFn: (row: any) => row.original?.data, + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
+ + + +

{row?.original?.firstName}

+
+ ), + }, + { + id: 'email', + accessorFn: (row: any) => row.original?.email, + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
{row.original?.email}
+ ), + }, + { + id: 'dateOfBirth', + accessorFn: (row: any) => row.original?.dateOfBirth, + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
{row.original?.dateOfBirth}
+ ), + }, + { + id: 'isActivated', + accessorFn: (row: any) => row.original?.isActivated, + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
{row.original?.isActivated ? Active : Deactive}
+ ), + }, + { + id: 'last_online_at', + accessorFn: (row: any) => row.original?.lastOnline, + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
+ {row.original?.lastOnline ?? '-'} +
+ ), + }, +] + return( + <> + + + ) +} + +export default UserTable \ No newline at end of file diff --git a/frontend/edu-connect/src/app/(admin)/admin/course/page.tsx b/frontend/edu-connect/src/app/(admin)/admin/course/page.tsx new file mode 100644 index 0000000..77c56fa --- /dev/null +++ b/frontend/edu-connect/src/app/(admin)/admin/course/page.tsx @@ -0,0 +1,56 @@ +'use client' +import UserTabContent from "@/app/user/profile/_partials/UserTabContent" +import BreadCrumbNav from "@/components/(dashboard)/common/BreadCumbNav/BreadCrumbNav" +import DataTable from "@/components/(dashboard)/common/DataTable/DataTable" +import ContentContainer from "@/components/(dashboard)/elements/ContentContainer" +import { PageHeading } from "@/components/(dashboard)/ui/title" +import CommonContainer from "@/components/elements/CommonContainer" +import AppContextProvider from "@/helpers/context/AppContextProvider" +import { defaultFetcher } from "@/helpers/fetch.helper" +import { routes } from "@/lib/routes" +import { APP_BASE_URL } from "@/utils/constants" +import AdminView from "@/views/AdminView" +import useSWR from "swr" +import UserTable from "./_partials/UserTable" + +const UsersIndexPage = () => { + const UserListURL = `${APP_BASE_URL}/api/admin/stats/userDetail` + const { data : UsersList , mutate , isLoading} = useSWR(UserListURL , defaultFetcher); + + + console.log(UsersList) + + return( + <> + + + + Users + + +
+ +
+
+
+
+
+ + ) +} + +export default UsersIndexPage +