/**
 * V21 Pagination 分页
 * 封装 Ant Design Pagination，应用 V21 设计系统样式
 */
import React from "react";
import { Pagination as AntPagination } from "antd";
import type { PaginationProps as AntPaginationProps } from "antd";
import classNames from "classnames";
import "./ui.css";

export interface PaginationProps extends AntPaginationProps {
  /** 使用 V21 样式 */
  v21?: boolean;
}

const Pagination: React.FC<PaginationProps> = ({
  className,
  v21 = true,
  ...rest
}) => {
  const v21Class = classNames(v21 && "xx-pagination", className);
  return <AntPagination className={v21Class} {...rest} />;
};

export default Pagination;
