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:
@@ -10,7 +10,7 @@ import {
|
||||
} from "@/components/ui/table";
|
||||
import TableSkeleton from "@/components/ui/TableSkeleton";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { capitalize, unixToDate } from "@/utils/shared";
|
||||
import { capitalize, getPaginatedRowNumber, unixToDate } from "@/utils/shared";
|
||||
|
||||
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
||||
import useFeedbackTablePresenter from "./useFeedbackTablePresenter";
|
||||
@@ -60,7 +60,7 @@ const FeedbackTable = ({ id, paramKey }: IProps) => {
|
||||
className="odd:bg-gray-2 dark:odd:bg-gray-7"
|
||||
>
|
||||
<TableCell className="text-start" colSpan={100}>
|
||||
{index + 1}
|
||||
{getPaginatedRowNumber({ index })}
|
||||
</TableCell>
|
||||
<TableCell className="uppercase" colSpan={100}>
|
||||
{item.feedback_type}
|
||||
|
||||
Reference in New Issue
Block a user