UNPKG

@keycloakify/keycloak-admin-ui

Version:
12 lines 927 B
import { jsx as _jsx } from "react/jsx-runtime"; import { useTranslation } from "react-i18next"; import { Controller, useFormContext } from "react-hook-form"; import { FormGroup } from "@patternfly/react-core"; import { CodeEditor, Language } from "@patternfly/react-code-editor"; import { HelpItem } from "../../../ui-shared"; export const JavaScript = () => { const { t } = useTranslation(); const { control } = useFormContext(); return (_jsx(FormGroup, { label: t("code"), labelIcon: _jsx(HelpItem, { helpText: t("policyCodeHelp"), fieldLabelId: "code" }), fieldId: "code", isRequired: true, children: _jsx(Controller, { name: "code", defaultValue: "", control: control, render: ({ field }) => (_jsx(CodeEditor, { id: "code", "data-testid": "code", onChange: field.onChange, code: field.value, height: "600px", language: Language.javascript, isReadOnly: true })) }) })); }; //# sourceMappingURL=JavaScript.js.map