import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Tab, Tabs, TabTitleText } from "@patternfly/react-core"; import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; import { useAdminClient, useFetch } from "../context/auth/AdminClient"; import { useRealm } from "../context/realm-context/RealmContext"; import { AssociatedRolesTab } from "../realm-roles/AssociatedRolesTab"; import { KeycloakSpinner } from "../components/keycloak-spinner/KeycloakSpinner"; import { DefaultsGroupsTab } from "./DefaultGroupsTab"; export const UserRegistration = () => { const { t } = useTranslation("realm-settings"); const [realm, setRealm] = useState(); const [activeTab, setActiveTab] = useState(10); const [key, setKey] = useState(0); const adminClient = useAdminClient(); const { realm: realmName } = useRealm(); useFetch( () => adminClient.realms.findOne({ realm: realmName }), setRealm, [] ); if (!realm) { return ; } return ( setActiveTab(key as number)} > {t("defaultRoles")}} > setKey(key + 1)} /> {t("defaultGroups")}} > ); };