import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { Controller, useForm } from "react-hook-form"; import { ActionGroup, Button, FormGroup, PageSection, Select, SelectOption, SelectVariant, } from "@patternfly/react-core"; import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; import { FormAccess } from "../components/form-access/FormAccess"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { useServerInfo } from "../context/server-info/ServerInfoProvider"; import { convertToFormValues } from "../util"; type RealmSettingsThemesTabProps = { realm: RealmRepresentation; save: (realm: RealmRepresentation) => void; }; export const RealmSettingsThemesTab = ({ realm, save, }: RealmSettingsThemesTabProps) => { const { t } = useTranslation("realm-settings"); const [loginThemeOpen, setLoginThemeOpen] = useState(false); const [accountThemeOpen, setAccountThemeOpen] = useState(false); const [adminConsoleThemeOpen, setAdminConsoleThemeOpen] = useState(false); const [emailThemeOpen, setEmailThemeOpen] = useState(false); const { control, handleSubmit, setValue } = useForm(); const themeTypes = useServerInfo().themes!; const setupForm = () => { convertToFormValues(realm, setValue); }; useEffect(setupForm, []); return ( } > ( )} /> } > ( )} /> } > ( )} /> } > ( )} /> ); };