import React from 'react';
import TopScrollList from '../TopScrollList';
import ListBox from './ListBox';

const CardList = ({ className = '', data, offsetOptions = { xxl: 3, xl: 2 }, listRef, itemGrid, itemHeight, loadMore, hasLoadMore, isNoData, renderItem, gutter = 14, ...rest }) => {
  return (
    <ListBox offsetOptions={offsetOptions} style={{position:'relative'}} className={className}>
      <TopScrollList
        ref={listRef}
        gutter={gutter}
        itemGrid={itemGrid}
        itemHeight={itemHeight}
        loadMore={loadMore}
        hasLoadMore={hasLoadMore}
        hasBackTop
        isNoData={isNoData}
        data={data}
        renderItem={renderItem}
        {...rest}
      />
    </ListBox>
  );
};

export default CardList;
