This commit is contained in:
estifanos
2026-08-11 11:39:46 +00:00
parent 1b0a21c683
commit 18de7b1c1d
2 changed files with 4 additions and 4 deletions

View File

@@ -56,8 +56,8 @@ Copy `AdvancedTable.tsx` and `useServerTable.ts` into the new project (e.g. `src
| `pageIndex` | `number` | yes | 0-based current page. |
| `onPageChange` | `(pageIndex: number) => void` | yes | |
| `pageSize` | `number` | no | Default `10`. Pagination only renders when `itemCount > pageSize`. |
| `onPageSizeChange` | `(pageSize: number) => void` | no | Shows a page-size `<Select>` (10/20/50/100 by default) next to the pagination when given. |
| `pageSizeOptions` | `number[]` | no | Options for the page-size select. Default `[10, 20, 50, 100]`. |
| `onPageSizeChange` | `(pageSize: number) => void` | no | Shows a page-size `<Select>` (10/20/30/40/50 by default) next to the pagination when given. |
| `pageSizeOptions` | `number[]` | no | Options for the page-size select. Default `[10, 20, 30, 40, 50]`. |
| `refresh` | `() => void` | no | Shows a Refresh button when provided. |
| `onSearchChange` | `(q: string) => void` | no | Reserved for a search box; not currently rendered by the component itself (wire your own input and call this, or drive `useServerTable`'s `setQ`). |
| `isLoading` | `boolean` | no | Shows a loader row; also spins the Refresh button. |

View File

@@ -40,7 +40,7 @@ interface AdvancedTableProps<T> {
pageSize?: number;
/** Shows a page-size <Select> when given; called with the chosen size. */
onPageSizeChange?: (pageSize: number) => void;
/** Options for the page-size select. Default [10, 20, 50, 100]. */
/** Options for the page-size select. Default [10, 20, 30, 40, 50]. */
pageSizeOptions?: number[];
refresh?: () => void;
/** Server-side search — debounced internally. Omit to hide the search box. */
@@ -73,7 +73,7 @@ export function AdvancedTable<T extends { id?: string | number }>({
onPageChange,
pageSize = 10,
onPageSizeChange,
pageSizeOptions = [10, 20, 50, 100],
pageSizeOptions = [10, 20, 30, 40, 50],
refresh,
isLoading = false,
emptyText,