mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
1eaba6e77f
* sort by groups first * add scroll area * fix group members pagination * move pagination to the right
45 lines
932 B
TypeScript
45 lines
932 B
TypeScript
import { Button, Group } from "@mantine/core";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
export interface PagePaginationProps {
|
|
currentPage: number;
|
|
hasPrevPage: boolean;
|
|
hasNextPage: boolean;
|
|
onPageChange: (newPage: number) => void;
|
|
}
|
|
|
|
export default function Paginate({
|
|
currentPage,
|
|
hasPrevPage,
|
|
hasNextPage,
|
|
onPageChange,
|
|
}: PagePaginationProps) {
|
|
const { t } = useTranslation();
|
|
|
|
if (!hasPrevPage && !hasNextPage) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Group mt="md" justify="flex-end">
|
|
<Button
|
|
variant="default"
|
|
size="compact-sm"
|
|
onClick={() => onPageChange(currentPage - 1)}
|
|
disabled={!hasPrevPage}
|
|
>
|
|
{t("Prev")}
|
|
</Button>
|
|
|
|
<Button
|
|
variant="default"
|
|
size="compact-sm"
|
|
onClick={() => onPageChange(currentPage + 1)}
|
|
disabled={!hasNextPage}
|
|
>
|
|
{t("Next")}
|
|
</Button>
|
|
</Group>
|
|
);
|
|
}
|