import { Controller, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { FormGroup, Switch, ValidatedOptions } from "@patternfly/react-core"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { FormAccess } from "../components/form-access/FormAccess"; import { KeycloakTextInput } from "../components/keycloak-text-input/KeycloakTextInput"; import { KeycloakTextArea } from "../components/keycloak-text-area/KeycloakTextArea"; type ClientDescriptionProps = { protocol?: string; hasConfigureAccess?: boolean; }; export const ClientDescription = ({ hasConfigureAccess: configure, }: ClientDescriptionProps) => { const { t } = useTranslation("clients"); const { register, control, formState: { errors }, } = useFormContext(); return ( } label={t("common:clientId")} fieldId="kc-client-id" helperTextInvalid={t("common:required")} validated={ errors.clientId ? ValidatedOptions.error : ValidatedOptions.default } isRequired > } label={t("common:name")} fieldId="kc-name" > } label={t("common:description")} fieldId="kc-description" validated={ errors.description ? ValidatedOptions.error : ValidatedOptions.default } helperTextInvalid={errors.description?.message} > } fieldId="kc-always-display-in-console" hasNoPaddingTop > ( )} /> ); };