564441899b
* merge all namespaces into one added fallback namespace to the configuration to minimize changes to the keys * small fix * Fix the broken `OverridesBackend` * remove stray console log * restore ns argument * PR review * merge main --------- Co-authored-by: Jon Koops <jonkoops@gmail.com>
21 lines
592 B
TypeScript
21 lines
592 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { PageSection } from "@patternfly/react-core";
|
|
|
|
import type { AccessType } from "@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation";
|
|
|
|
type ForbiddenSectionProps = {
|
|
permissionNeeded: AccessType | AccessType[];
|
|
};
|
|
|
|
export const ForbiddenSection = ({
|
|
permissionNeeded,
|
|
}: ForbiddenSectionProps) => {
|
|
const { t } = useTranslation();
|
|
const count = Array.isArray(permissionNeeded) ? permissionNeeded.length : 1;
|
|
|
|
return (
|
|
<PageSection>
|
|
{t("forbidden", { count })} {permissionNeeded}
|
|
</PageSection>
|
|
);
|
|
};
|