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

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

export default MyCoursesList;
