Skip to content

Commit

Permalink
allow antd pagination options in ServerTable
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammedMaaz committed Apr 30, 2024
1 parent cf981d3 commit 0dd709e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agenta-web/src/components/ServerTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ interface Props<T> {
headersSelection?: boolean
colsDraggable?: boolean
colsResizable?: boolean
pagination?: boolean
columns: DataCol<T>[]
headerExtra?: ReactNode
defaultTableParams?: Partial<TableParams>
deleteTrigger: boolean
}

const ServerTable = <T extends AnyObject>(
props: Omit<React.ComponentProps<typeof Table<T>>, "pagination" | "columns"> & Props<T>,
props: Omit<React.ComponentProps<typeof Table<T>>, "columns"> & Props<T>,
) => {
const classes = useStyles()
const [columns, setColumns] = useState<DataCol<T>[]>((props.columns || []) as DataCol<T>[])
Expand Down Expand Up @@ -166,6 +165,7 @@ const ServerTable = <T extends AnyObject>(
loading={loading}
pagination={
!!props.pagination && {
...props.pagination,
pageSize: tableParams?.pagination?.pageSize || 20,
current: tableParams?.pagination?.page || 1,
total: total.current,
Expand Down

0 comments on commit 0dd709e

Please sign in to comment.