"use client"; import { type Table } from "@tanstack/react-table"; import { Pagination } from "@calcom/ui/components/pagination"; import { useDataTable } from "@calcom/features/data-table/hooks"; interface DataTablePaginationProps { table: Table; totalRowCount?: number; paginationMode?: "infinite" | "standard"; } export function DataTablePagination({ table, totalRowCount, paginationMode = "infinite", }: DataTablePaginationProps) { const { pageIndex, pageSize, setPageIndex, setPageSize } = useDataTable(); if (!totalRowCount) { return null; } if (paginationMode === "infinite") { const loadedCount = table.getRowModel().rows.length; return (

Loaded {loadedCount} of{" "} {totalRowCount}

); } else if (paginationMode === "standard") { return ( setPageSize(newSize)} onPageChange={(page) => setPageIndex(page - 1)} /> ); } else { return null; } }