import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Control, Controller } from "react-hook-form"; import { ActionGroup, Button, FormGroup, Select, SelectOption, SelectVariant, Switch, } from "@patternfly/react-core"; import { FormAccess } from "../../components/form-access/FormAccess"; import { HelpItem } from "../../components/help-enabler/HelpItem"; import { TimeSelector } from "../../components/time-selector/TimeSelector"; import { TokenLifespan } from "./TokenLifespan"; import { KeyValueInput } from "../../components/key-value-form/KeyValueInput"; type AdvancedSettingsProps = { control: Control>; save: () => void; reset: () => void; protocol?: string; }; export const AdvancedSettings = ({ control, save, reset, protocol, }: AdvancedSettingsProps) => { const { t } = useTranslation("clients"); const [open, setOpen] = useState(false); return ( {protocol !== "openid-connect" && ( } > ( )} /> )} {protocol === "openid-connect" && ( <> } > ( onChange("" + value)} /> )} /> } > ( )} /> } > ( onChange(value.toString())} /> )} /> } > )} ); };