import { FormGroup, Select, SelectOption, SelectVariant, Switch, } from "@patternfly/react-core"; import { useState } from "react"; import { Controller, Path, PathValue, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { FormAccess } from "../../components/form-access/FormAccess"; import { HelpItem } from "ui-shared"; import { convertAttributeNameToForm } from "../../util"; import { FormFields } from "../ClientDetails"; type ToggleProps = { name: PathValue>; label: string; }; export const Toggle = ({ name, label }: ToggleProps) => { const { t } = useTranslation("clients"); const { control } = useFormContext(); return ( } > ( field.onChange(value.toString())} aria-label={t(label)} /> )} /> ); }; export const SamlConfig = () => { const { t } = useTranslation("clients"); const { control } = useFormContext(); const [nameFormatOpen, setNameFormatOpen] = useState(false); return ( } > ( )} /> ); };