[] = [
+ {
+ accessorKey: "sn",
+ header: "SN",
+ cell: ({ row }) => (
+ {row.index + 1}
+ ),
+ },
+ {
+ id: 'name',
+ accessorFn: (row: any) => row.original?.name,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+
+
+
+
+
{row.original?.name}
+
+ ),
+ },
+ {
+ id: 'description',
+ accessorFn: (row: any) => row.original?.description,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+ {row.original?.description ?? '-'}
+ ),
+ },
+ {
+ id: 'author',
+ accessorFn: (row: any) => row.original?.author?.firstName,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+ {row.original?.author?.firstName} {row.original?.author?.lastName}
+ ),
+ },
+ {
+ id: 'category',
+ accessorFn: (row: any) => row.original?.category?.name,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+ {row.original?.category?.name}
+ ),
+ },
+ {
+ id: 'creationDate',
+ accessorFn: (row: any) => row.original?.creationDate,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+
+ {row.original?.creationDate ? new Date(row.original.creationDate).toLocaleDateString() : '-'}
+
+ ),
+ },
+ {
+ id: 'isActive',
+ accessorFn: (row: any) => row.original?.isActive,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+ {row.original?.isActive ? Active : Deactive}
+ ),
+ },
+ {
+ id: 'totalEnrolled',
+ accessorFn: (row: any) => row.original?.totalEnrolled,
+ header: ({ column }) => (
+
+ ),
+ cell: ({ row }) => (
+
+ {row.original?.totalEnrolled ?? '-'}
+
+ ),
+ },
+ ]
+
+ return(
+ <>
+
+ >
+ )
+}
+
+export default CourseTable
\ 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..3f840e6
--- /dev/null
+++ b/frontend/edu-connect/src/app/(admin)/admin/course/page.tsx
@@ -0,0 +1,48 @@
+'use client'
+import BreadCrumbNav from "@/components/(dashboard)/common/BreadCumbNav/BreadCrumbNav"
+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 CourseTable from "./_partials/CourseTable"
+
+const CourseIndexPage = () => {
+ const CourseListURL = `${APP_BASE_URL}/api/course/listall`
+ const { data, mutate, isLoading } = useSWR(CourseListURL, defaultFetcher);
+
+ return (
+
+
+
+ Courses
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default CourseIndexPage
\ No newline at end of file
diff --git a/frontend/edu-connect/src/lib/routes.ts b/frontend/edu-connect/src/lib/routes.ts
index 1a53bf6..ea26e0d 100644
--- a/frontend/edu-connect/src/lib/routes.ts
+++ b/frontend/edu-connect/src/lib/routes.ts
@@ -6,6 +6,8 @@ export const routes = {
PROFILE_ROUTE : '/user/profile',
MY_COURSES_INDEX : '/my-courses',
USER_INDEX_PAGE : '/admin/users',
+ COURSE_INDEX_PAGE: '/admin/course',
+ CATEGORY_INDEX_PAGE: '/admin/category',
COURSE_INDIVIDUAL_PAGE : '/course/show/:id'
}