add unique title to pagination controls (#17542)

fixes: keycloak/keycloak-ui#4501
This commit is contained in:
Erik Jan de Wit 2023-03-13 07:46:10 +01:00 committed by GitHub
parent 4f4c850766
commit f5ebe675a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import {
ToolbarItem,
} from "@patternfly/react-core";
import { PropsWithChildren, ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { TableToolbar } from "./TableToolbar";
@ -37,10 +38,14 @@ const KeycloakPagination = ({
onPreviousClick,
onPerPageSelect,
}: KeycloakPaginationProps) => {
const { t } = useTranslation("user-federation");
const page = Math.round(first / max);
return (
<Pagination
widgetId={id}
titles={{
paginationTitle: `${t("pagination")} ${variant} `,
}}
isCompact
toggleTemplate={({ firstIndex, lastIndex }: ToggleTemplateProps) => (
<b>