Debian Codegraph @

install/freeipa-webui/src/components/layouts/PopoverWithIconLayout/PopoverWithIconLayout.tsx

raw
1 import React from "react";
2 // PatternFly
3 import { Popover } from "@patternfly/react-core";
4 // Icons
5 import { OutlinedQuestionCircleIcon } from "@patternfly/react-icons";
6
7 interface PropsToPopover {
8 message: React.ReactNode | ((hide: () => void) => React.ReactNode);
9 showClose?: boolean;
10 ariaLabel?: string;
11 hasNoPadding?: boolean;
12 withFocusTrap?: boolean;
13 hasAutoWidth?: boolean;
14 triggerHover?: boolean;
15 }
16
17 const PopoverWithIconLayout = (props: PropsToPopover) => {
18 return (
19 <Popover
20 aria-label={
21 props.ariaLabel || "Popover with no header, footer, and close button"
22 }
23 triggerAction={props.triggerHover ? "hover" : "click"}
24 hasNoPadding={props.hasNoPadding || false}
25 showClose={props.showClose || false}
26 bodyContent={props.message}
27 withFocusTrap={props.withFocusTrap || false}
28 hasAutoWidth={props.hasAutoWidth || false}
29 >
30 <OutlinedQuestionCircleIcon className="pf-v6-u-color-200" />
31 </Popover>
32 );
33 };
34
35 export default PopoverWithIconLayout;