/**
 * 未使用 验证中
 */
import { TableDropdown } from '@ant-design/pro-components';
import React from 'react';

export type TablePaginationCardProps = {
  total: number;
  pageSize: number;
  current: number;
  // eslint-disable-next-line @typescript-eslint/ban-types
  onChange: Function
  
};
// 分页器
const TablePaginationCard: React.FC<TablePaginationCardProps> = (props) => {
  const { total, pageSize, current, onChange } = props;
  const totalPage = Math.ceil(total / pageSize);

  const handleChange = (page: number, pageSize: number) => {
    onChange(page, pageSize);
  };

  return (
    <div>
      <span>
        Total {total} items, {totalPage} pages
      </span>
      <TableDropdown
        total={totalPage as number}
        current={current}
        pageSize={pageSize}
        onClick={(e) => handleChange(e, pageSize)}
      />
    </div>
  );
};

export default TablePaginationCard;
