import React from 'react';
import CourseCard from './CourseCard';

// 课程列表
const CoursesList = ({ coursesData, subsetTab, getCourses }) => {
  if (coursesData == null || coursesData.length === 0) return <div></div>;
  return (
    <div className='w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4'>
      {coursesData.map((course) => (
        <CourseCard
          key={course.Code}
          course={course}
          subsetTab={subsetTab}
          getCourses={getCourses}
        />
      ))}
    </div>
  );
};

export default CoursesList;
