import React, { isValidElement, ReactNode, useContext } from "react"; import { Popover } from "@patternfly/react-core"; import { HelpIcon } from "@patternfly/react-icons"; import { useTranslation } from "react-i18next"; import { HelpContext } from "./HelpHeader"; type HelpItemProps = { helpText: string | ReactNode; forLabel: string; forID: string; noVerticalAlign?: boolean; unWrap?: boolean; id?: string; }; export const HelpItem = ({ helpText, forLabel, forID, id, noVerticalAlign = true, unWrap = false, }: HelpItemProps) => { const { t } = useTranslation(); const { enabled } = useContext(HelpContext); return ( <> {enabled && ( <> {!unWrap && ( )} {unWrap && } )} ); };