UNPKG

@keycloakify/keycloak-admin-ui

Version:
18 lines 935 B
import { jsx as _jsx } from "react/jsx-runtime"; import { FormGroup } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { HelpItem } from "../../ui-shared"; import { useFormContext, useWatch } from "react-hook-form"; import { FormattedLink } from "../../components/external-link/FormattedLink"; import "./url-component.css"; export const UrlComponent = ({ name, label, helpText }) => { const { t } = useTranslation(); const { control } = useFormContext(); const { value } = useWatch({ control, name: name, defaultValue: "", }); return (_jsx(FormGroup, { label: t(label), fieldId: name, labelIcon: _jsx(HelpItem, { helpText: t(helpText), fieldLabelId: `${label}` }), className: "keycloak__identity-providers__url_component", children: _jsx(FormattedLink, { title: t(helpText), href: value, isInline: true }) })); }; //# sourceMappingURL=UrlComponent.js.map