@keycloakify/keycloak-account-ui
Version:
Repackaged Keycloak Account UI
9 lines • 902 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Icon, Popover } from "@patternfly/react-core";
import { HelpIcon } from "@patternfly/react-icons";
import { useHelp } from "../../ui-shared/context/HelpContext";
export const HelpItem = ({ helpText, fieldLabelId, noVerticalAlign = true, unWrap = false, }) => {
const { enabled } = useHelp();
return enabled ? (_jsx(Popover, { bodyContent: helpText, children: _jsxs(_Fragment, { children: [!unWrap && (_jsx("button", { "data-testid": `help-label-${fieldLabelId}`, "aria-label": fieldLabelId, onClick: (e) => e.preventDefault(), className: "pf-v5-c-form__group-label-help", children: _jsx(Icon, { isInline: noVerticalAlign, children: _jsx(HelpIcon, {}) }) })), unWrap && (_jsx(Icon, { isInline: noVerticalAlign, children: _jsx(HelpIcon, {}) }))] }) })) : null;
};
//# sourceMappingURL=HelpItem.js.map