2021-12-14 22:46:19 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { FormGroup } from "@patternfly/react-core";
|
|
|
|
|
|
|
|
import type { ComponentProps } from "./components";
|
|
|
|
import { HelpItem } from "../help-enabler/HelpItem";
|
2022-04-20 17:11:46 +00:00
|
|
|
import { KeyValueInput } from "../key-value-form/KeyValueInput";
|
2021-12-14 22:46:19 +00:00
|
|
|
|
|
|
|
export const MapComponent = ({ name, label, helpText }: ComponentProps) => {
|
|
|
|
const { t } = useTranslation("dynamic");
|
|
|
|
|
|
|
|
return (
|
|
|
|
<FormGroup
|
|
|
|
label={t(label!)}
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem helpText={t(helpText!)} fieldLabelId={`dynamic:${label}`} />
|
|
|
|
}
|
|
|
|
fieldId={name!}
|
|
|
|
>
|
2022-04-20 17:11:46 +00:00
|
|
|
<KeyValueInput name={`config.${name}`} />
|
2021-12-14 22:46:19 +00:00
|
|
|
</FormGroup>
|
|
|
|
);
|
|
|
|
};
|