Commit ca5d4a0 1 parent 039528a commit ca5d4a0 Copy full SHA for ca5d4a0
File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Tooltip , OverlayTrigger , Button } from 'react-bootstrap' ;
3
+ import { Placement } from "react-bootstrap/esm/types"
4
+
5
+ interface TooltipComponentType {
6
+ placement ?: Placement
7
+ message : string
8
+ children : React . ReactNode
9
+ }
10
+ const TooltipComponent :React . FC < TooltipComponentType > = ( { message, children, placement= 'top' } ) => {
11
+ const renderTooltip = ( props :any ) => (
12
+ < Tooltip { ...props } >
13
+ { message }
14
+ </ Tooltip >
15
+ ) ;
16
+
17
+ return (
18
+ < OverlayTrigger
19
+ placement = { placement }
20
+ delay = { { show : 250 , hide : 400 } }
21
+ overlay = { renderTooltip }
22
+ >
23
+ < Button variant = "secondary" >
24
+ { children }
25
+ </ Button >
26
+ </ OverlayTrigger >
27
+ ) ;
28
+ } ;
29
+
30
+ export default TooltipComponent ;
You can’t perform that action at this time.
0 commit comments