import type { TableProps } from "antd"; import { Table } from "antd"; interface XTableProps extends TableProps { className?: string; } // TODO: antd table 组件相比 shadcn/ui 开发效率更高 // 等未来有时间,可以将 xtable 实现替换成 shadcn/ui table export function XTable({ className, ...props }: XTableProps) { return ( tableLayout="fixed" {...props} className={className} scroll={{ x: "max-content" }} // size="middle" pagination={{ showSizeChanger: true, showQuickJumper: false, position: ["bottomRight"], showTotal: (total) => `共 ${total} 条`, size: "small", ...props.pagination, pageSizeOptions: ["10", "20", "30", "50"], }} style={{ width: "100%", overflowX: "auto", paddingBottom: 8, ...props.style, }} /> ); }