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