import { Tab, TabTitleText } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { RoutableTabs, useRoutableTab, } from "../../components/routable-tabs/RoutableTabs"; import { useRealm } from "../../context/realm-context/RealmContext"; import { toUserProfile, UserProfileTab as IUserProfileTab, } from "../routes/UserProfile"; import { AttributesGroupTab } from "./AttributesGroupTab"; import { AttributesTab } from "./AttributesTab"; import { JsonEditorTab } from "./JsonEditorTab"; import { UserProfileProvider } from "./UserProfileContext"; export const UserProfileTab = () => { const { realm } = useRealm(); const { t } = useTranslation("realm-settings"); const useTab = (tab: IUserProfileTab) => useRoutableTab(toUserProfile({ realm, tab })); const attributesTab = useTab("attributes"); const attributesGroupTab = useTab("attributes-group"); const jsonEditorTab = useTab("json-editor"); return ( {t("attributes")}} data-testid="attributesTab" {...attributesTab} > {t("attributesGroup")}} data-testid="attributesGroupTab" {...attributesGroupTab} > {t("jsonEditor")}} data-testid="jsonEditorTab" {...jsonEditorTab} > ); };