Debian Codegraph @

node/@patternfly/react-core/src/components/Hint/Hint.tsx

raw
1 import styles from '@patternfly/react-styles/css/components/Hint/hint';
2 import { css } from '@patternfly/react-styles';
3
4 export interface HintProps {
5 /** Content rendered inside the hint. */
6 children?: React.ReactNode;
7 /** Additional classes applied to the hint. */
8 className?: string;
9 /** Actions of the hint. */
10 actions?: React.ReactNode;
11 /** Flag indicating that the actions have no offset */
12 hasNoActionsOffset?: boolean;
13 }
14
15 export const Hint: React.FunctionComponent<HintProps> = ({
16 children,
17 className,
18 actions,
19 hasNoActionsOffset = false,
20 ...props
21 }: HintProps) => (
22 <div className={css(styles.hint, className)} {...props}>
23 {actions && (
24 <div className={css(styles.hintActions, hasNoActionsOffset && styles.modifiers.noOffset)}>{actions}</div>
25 )}
26 {children}
27 </div>
28 );
29 Hint.displayName = 'Hint';