import React from "react"; import { useTranslation } from "react-i18next"; import { FormGroup, Switch, Checkbox, Grid, GridItem, } from "@patternfly/react-core"; import { Controller, useFormContext } from "react-hook-form"; import { FormAccess } from "../../components/form-access/FormAccess"; import { ClientForm } from "../ClientDetails"; import { HelpItem } from "../../components/help-enabler/HelpItem"; type CapabilityConfigProps = { unWrap?: boolean; protocol?: string; }; export const CapabilityConfig = ({ unWrap, protocol: type, }: CapabilityConfigProps) => { const { t } = useTranslation("clients"); const { control, watch } = useFormContext(); const protocol = type || watch("protocol"); return ( <> {protocol === "openid-connect" && ( <> ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> )} <> {protocol === "saml" && ( <> } label={t("encryptAssertions")} fieldId="kc-encrypt" > ( onChange("" + value)} /> )} /> } label={t("clientSignature")} fieldId="kc-client-signature" > ( onChange("" + value)} /> )} /> )} ); };