feat: implement standard pagination for org member list (#19802)
* feat: implement standard pagination for org member list * fix type error * i18n for pagination * add paginationMode * apply the change to PlatformManagedUsersTable * replace useInfiniteQuery with useQuery * fix type error * fix type error * fix type error * fix type error * update comment * remove optimistic update * minor changes * update usage on nuqs --------- Co-authored-by: Benny Joo <[email protected]>
This commit is contained in:
1 parent
861e3aa24f
commit
7eee2728a2
24 files changed
+403
-388
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
import { Button } from "../button";
|
||||
import { ButtonGroup } from "../buttonGroup";
|
||||
import { Select } from "../form/select";
|
||||
@@ -29,6 +31,7 @@ export const Pagination = ({
|
||||
onNext,
|
||||
onPrevious,
|
||||
}: PaginationProps) => {
|
||||
const { t } = useLocale();
|
||||
const [internalPageSize, setInternalPageSize] = useState(pageSize);
|
||||
const totalPages = Math.ceil(totalItems / pageSize);
|
||||
|
||||
@@ -73,11 +76,14 @@ export const Pagination = ({
|
||||
onChange={handlePageSizeChange}
|
||||
size="sm"
|
||||
/>
|
||||
<span className="text-default text-sm">rows per page</span>
|
||||
<span className="text-default text-sm">{t("rows_per_page")}</span>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<span className="text-default text-sm">
|
||||
{startItem}-{endItem} of {totalItems}
|
||||
{t("pagination_status", {
|
||||
currentRange: `${startItem}-${endItem}`,
|
||||
totalItems,
|
||||
})}
|
||||
</span>
|
||||
<ButtonGroup containerProps={{ className: "space-x-1.5" }}>
|
||||
<Button
|
||||
|
||||
Reference in new issue
Block a user