// components/CourseList.jsx /** * Course List Component * * Displays a grid of course cards or skeleton placeholders while loading. */ // No imports needed as React is available globally const CourseList = ({ courses = [], isLoading = true, itemsPerPage = 6 }) => { console.log('CourseList rendering with:', { courses, isLoading, itemsPerPage }); // If loading, show skeleton cards if (isLoading) { return (
{Array(itemsPerPage).fill(null).map((_, index) => (
))}
); } // If no courses found, show message if (!courses || courses.length === 0) { return
No courses found
; } // Render actual course cards return (
{courses.map(course => (
{course.title}

{course.title}

{course.category}

{course.description}

{'★'.repeat(Math.floor(course.rating || 0))} {'☆'.repeat(5 - Math.floor(course.rating || 0))} {course.enrollment_count || 0} students
))}
); }; // Make CourseList component available globally window.CourseList = CourseList;