import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { FormGroup, TextInput, Form, Switch, TextArea, Select, SelectVariant, SelectOption, } from "@patternfly/react-core"; import { Controller, useFormContext } from "react-hook-form"; import { ScrollForm } from "../components/scroll-form/ScrollForm"; import { ClientDescription } from "./ClientDescription"; import { CapabilityConfig } from "./add/CapabilityConfig"; import { MultiLineInput } from "../components/multi-line-input/MultiLineInput"; import { FormAccess } from "../components/form-access/FormAccess"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { useServerInfo } from "../context/server-info/ServerInfoProvider"; import { SaveReset } from "./advanced/SaveReset"; type ClientSettingsProps = { save: () => void; reset: () => void; }; export const ClientSettings = ({ save, reset }: ClientSettingsProps) => { const { register, control, watch } = useFormContext(); const { t } = useTranslation("clients"); const [loginThemeOpen, setLoginThemeOpen] = useState(false); const loginThemes = useServerInfo().themes!["login"]; const consentRequired: boolean = watch("consentRequired"); const displayOnConsentScreen: string = watch( "attributes.display-on-consent-screen" ); return ( <>
} > } > } > } > } > } fieldId="loginTheme" > ( )} /> ( )} /> ( onChange("" + value)} isDisabled={!consentRequired} /> )} />