feat(Tables): implement pagination and loading state handling across multiple tables

- Added `getPaginatedRowNumber` utility function to calculate the correct row number based on pagination.
- Integrated `isLoading` prop in `EmptyListWrapper` to conditionally render loading state.
- Updated various table components (Admins, CMS, Companies, Inquiries, etc.) to utilize the new pagination logic and loading state handling.
- Wrapped pagination components in `IsVisible` to conditionally display based on data availability.
This commit is contained in:
AmirReza Jamali
2026-04-15 15:57:36 +03:30
parent 2e3b721585
commit c1b6b4ccf1
16 changed files with 149 additions and 65 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ import {
} from "@/components/ui/table";
import TableSkeleton from "@/components/ui/TableSkeleton";
import { _TooltipDefaultParams } from "@/constants/tooltip";
import { formatPhoneNumber } from "@/utils/shared";
import { formatPhoneNumber, getPaginatedRowNumber } from "@/utils/shared";
import { Tooltip } from "react-tooltip";
import { useCompanyListPresenter } from "./useCompanyListPresenter";
import ListHeader from "@/components/ui/ListHeader";
@@ -81,7 +81,7 @@ const CompaniesTable = () => {
className="odd:bg-gray-2 dark:odd:bg-gray-7"
>
<TableCell className="text-start" colSpan={100}>
{index + 1}
{getPaginatedRowNumber({ index })}
</TableCell>
<TableCell className="text-start" colSpan={100}>
{company.name}