import { MyPaginationMetaType } from '@/common';
import { Pagination } from 'antd';

export function MyModalPagination({
  meta,
  setParams,
}: {
  meta?: MyPaginationMetaType | null;
  setParams?: ({ page, perPage }: { page: number; perPage: number }) => void;
}) {
  console.log(meta, 'meta2222');
  if (!meta) return null;
  return (
    <div style={{ textAlign: 'right' }}>
      <Pagination
        style={{ padding: '10px 0' }}
        current={meta?.current_page || 1}
        total={meta?.total || 0}
        pageSize={meta?.per_page || 20}
        onChange={(page, perPage) => setParams?.({ page, perPage })}
        size="small"
        showTotal={(total) => `总共${total}条`}
        showSizeChanger
        showQuickJumper
      />
    </div>
  );
}
