import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Controller, useFormContext } from "react-hook-form"; import { ActionGroup, Button, ClipboardCopy, FormGroup, PageSection, Select, SelectOption, SelectVariant, Stack, StackItem, Switch, TextInput, } from "@patternfly/react-core"; import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; import { getBaseUrl } from "../util"; import { useAdminClient } from "../context/auth/AdminClient"; import { useRealm } from "../context/realm-context/RealmContext"; import { FormAccess } from "../components/form-access/FormAccess"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { FormattedLink } from "../components/external-link/FormattedLink"; type RealmSettingsGeneralTabProps = { save: (realm: RealmRepresentation) => void; reset: () => void; }; export const RealmSettingsGeneralTab = ({ save, reset, }: RealmSettingsGeneralTabProps) => { const { t } = useTranslation("realm-settings"); const adminClient = useAdminClient(); const { realm: realmName } = useRealm(); const { register, control, handleSubmit, formState: { isDirty }, } = useFormContext(); const [open, setOpen] = useState(false); const baseUrl = getBaseUrl(adminClient); const requireSslTypes = ["all", "external", "none"]; return ( ( {value} )} /> } > } > ( )} /> } fieldId="kc-user-manged-access" > ( )} /> } fieldId="kc-endpoints" > ); };