diff --git a/apps/admin-ui/src/components/dynamic/TextComponent.tsx b/apps/admin-ui/src/components/dynamic/TextComponent.tsx new file mode 100644 index 0000000000..e2e8287dd9 --- /dev/null +++ b/apps/admin-ui/src/components/dynamic/TextComponent.tsx @@ -0,0 +1,38 @@ +import { useTranslation } from "react-i18next"; +import { useFormContext } from "react-hook-form"; +import { FormGroup } from "@patternfly/react-core"; + +import { HelpItem } from "../help-enabler/HelpItem"; +import { KeycloakTextArea } from "../keycloak-text-area/KeycloakTextArea"; +import type { ComponentProps } from "./components"; +import { convertToName } from "./DynamicComponents"; + +export const TextComponent = ({ + name, + label, + helpText, + defaultValue, + isDisabled = false, +}: ComponentProps) => { + const { t } = useTranslation("dynamic"); + const { register } = useFormContext(); + + return ( + + } + fieldId={name!} + > + + + ); +}; diff --git a/apps/admin-ui/src/components/dynamic/components.ts b/apps/admin-ui/src/components/dynamic/components.ts index 87ab1cde11..9c7747c9d2 100644 --- a/apps/admin-ui/src/components/dynamic/components.ts +++ b/apps/admin-ui/src/components/dynamic/components.ts @@ -2,6 +2,7 @@ import type { FunctionComponent } from "react"; import type { ConfigPropertyRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation"; import { StringComponent } from "./StringComponent"; +import { TextComponent } from "./TextComponent"; import { BooleanComponent } from "./BooleanComponent"; import { ListComponent } from "./ListComponent"; import { RoleComponent } from "./RoleComponent"; @@ -20,6 +21,7 @@ export type ComponentProps = Omit & { const ComponentTypes = [ "String", + "Text", "boolean", "List", "Role", @@ -39,6 +41,7 @@ export const COMPONENTS: { [index in Components]: FunctionComponent; } = { String: StringComponent, + Text: TextComponent, boolean: BooleanComponent, List: ListComponent, Role: RoleComponent,