import React, { useState, useEffect } from "react"; import axios from "axios"; import * as XLSX from "xlsx-js-style"; const CourseConsolidated = () => { const [data, setData] = useState([]); const [loading, setLoading] = useState(true); const [currentPage, setCurrentPage] = useState(1); const tablesPerPage = 5; const [expandedCourse, setExpandedCourse] = useState(null); useEffect(() => { const fetchData = async () => { try { const response = await axios.get( "http://localhost:8080/api/table/course-consolidated" ); setData(response.data); setLoading(false); } catch (error) { console.error("Error fetching table data:", error); setLoading(false); } }; fetchData(); }, []); if (loading) { return
| Semester | Course Code | Course Name | Exam Type | Year | Oral/Practical | Assessment | Reassessment | Paper Setting | Moderation | PwD Paper Setting |
|---|---|---|---|---|---|---|---|---|---|---|
| {row.semester} | {row.courseCode} | {row.courseName} | {row.examType} | {row.year} |
{row.oralPracticalTeachers &&
row.oralPracticalTeachers.length > 0 ? (
|
{row.assesmentTeachers &&
row.assesmentTeachers.length > 0 ? (
|
{row.reassessmentTeachers &&
row.reassessmentTeachers.length > 0 ? (
|
{row.paperSettingTeachers &&
row.paperSettingTeachers.length > 0 ? (
|
{row.moderationTeachers &&
row.moderationTeachers.length > 0 ? (
|
{row.pwdPaperSettingTeachers &&
row.pwdPaperSettingTeachers.length > 0 ? (
|