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:
@@ -6,6 +6,7 @@ interface EmptyListWrapperProps<T> {
|
||||
emptyMessage: string;
|
||||
columns: string[];
|
||||
children: ReactNode;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
function EmptyListWrapper<T>({
|
||||
@@ -13,7 +14,12 @@ function EmptyListWrapper<T>({
|
||||
emptyMessage,
|
||||
columns,
|
||||
children,
|
||||
isLoading = false,
|
||||
}: EmptyListWrapperProps<T>) {
|
||||
if (isLoading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!list.length) {
|
||||
return (
|
||||
<TableRow>
|
||||
|
||||
Reference in New Issue
Block a user