mirror of https://github.com/grafana/grafana
InfoTooltip: Info icon with tooltip (#18478)
parent
993e5636d6
commit
93ecf63e70
@ -0,0 +1,9 @@ |
||||
import React from 'react'; |
||||
|
||||
import { storiesOf } from '@storybook/react'; |
||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; |
||||
import { InfoTooltip } from './InfoTooltip'; |
||||
|
||||
const story = storiesOf('UI/Tooltip', module); |
||||
story.addDecorator(withCenteredStory); |
||||
story.add('InfoTooltip', () => <InfoTooltip>This is the content of the tooltip</InfoTooltip>); |
@ -0,0 +1,15 @@ |
||||
import React from 'react'; |
||||
import { Tooltip, TooltipProps } from '../Tooltip/Tooltip'; |
||||
import { PopperContent } from '../Tooltip/PopperController'; |
||||
|
||||
interface InfoTooltipProps extends Omit<TooltipProps, 'children' | 'content'> { |
||||
children: PopperContent<any>; |
||||
} |
||||
|
||||
export const InfoTooltip = ({ children, ...restProps }: InfoTooltipProps) => { |
||||
return ( |
||||
<Tooltip content={children} {...restProps}> |
||||
<i className="fa fa-info-circle" /> |
||||
</Tooltip> |
||||
); |
||||
}; |
Loading…
Reference in new issue