@algorithm-shift/design-system 1.2.45 → 1.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2205,13 +2205,14 @@ var Table2 = ({
2205
2205
  itemsPerPage = 10,
2206
2206
  onPageChange,
2207
2207
  loading = false,
2208
+ totalRecords = 0,
2208
2209
  ...props
2209
2210
  }) => {
2210
2211
  const rawColumns = Array.isArray(columns) ? columns : [];
2211
2212
  const rawData = Array.isArray(data) ? data : [];
2212
2213
  const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
2213
2214
  const [currentPage, setCurrentPage] = useState3(1);
2214
- const enablePagination = pagination && rawData.length > itemsPerPage;
2215
+ const enablePagination = pagination && totalRecords > itemsPerPage;
2215
2216
  const handlePageChange = (page) => {
2216
2217
  setCurrentPage(page);
2217
2218
  onPageChange?.(page);
@@ -2231,7 +2232,7 @@ var Table2 = ({
2231
2232
  enablePagination && /* @__PURE__ */ jsx44(
2232
2233
  Pagination_default,
2233
2234
  {
2234
- totalPages: Math.ceil(rawData.length / itemsPerPage),
2235
+ totalPages: Math.ceil(totalRecords / itemsPerPage),
2235
2236
  currentPage,
2236
2237
  onPageChange: handlePageChange
2237
2238
  }