add: more commits

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-03 16:21:27 +08:00
parent 17326b2c2e
commit 7e964f2432
112 changed files with 9160 additions and 3461 deletions
@@ -1,5 +1,6 @@
import { useMemo, useRef, useState } from "react";
import { useNavigate } from "react-router-dom";
import api from "@/utils/api.util";
import { useCourses } from "@/contexts/AdminCoursesContext";
import { useAuth } from "@/contexts/AuthContext";
@@ -119,6 +120,16 @@ export default function CoursesTable() {
onArchive={(c) => archiveCourse(c?.course_id)}
loading={loading}
onSuccess={handleArchiveSuccess}
onImpactCheck={async () => {
const { data } = await api.get(
`/admin/courses/${archiveTarget?.course_id}/archive-impact`
);
const { activeCount, totalCount } = data?.data ?? {};
return [
{ label: "student(s) are currently taking this course", count: activeCount ?? 0 },
{ label: "student(s) have progress in this course", count: totalCount ?? 0 },
];
}}
/>
{/* ── Bulk archive ── */}