import React from 'react';
import Pagination from '../public/Pagination';
import Spacer from '../public/Spacer';
import CoursesList from './CoursesList';
/// 数据列表
function DataListWithPagination({
  coursesData,
  subsetTab,
  onPageChange,
  currentPage,
  totalItems,
  itemsPerPage,
}) {
  return (
    <div className='flex flex-col flex-grow w-full h-full justify-between'>
      <div>
        <CoursesList coursesData={coursesData} subsetTab={subsetTab} />
      </div>
      <div>
        <Spacer height={10} />
        <Pagination
          totalItems={totalItems}
          itemsPerPage={itemsPerPage}
          currentPage={currentPage}
          onPageChange={onPageChange}
        />
      </div>
    </div>
  );
}

export default DataListWithPagination;
