parent
6f90bb099d
commit
0bda3a543a
@ -0,0 +1,23 @@ |
||||
import React from 'react'; |
||||
import { Fragment } from 'react'; |
||||
import { OverlayTrigger, Tooltip } from 'react-bootstrap'; |
||||
import { CustomTooltipType } from '../../types/customtooltip' |
||||
|
||||
|
||||
function CustomTooltip({ children, placement, tooltipId, tooltipClasses, tooltipText }: CustomTooltipType) { |
||||
|
||||
return ( |
||||
<Fragment> |
||||
<OverlayTrigger |
||||
placement={placement} |
||||
overlay={ |
||||
<Tooltip id={tooltipId ?? `${tooltipText}Tooltip`} className={tooltipClasses}> |
||||
<span>{tooltipText}</span> |
||||
</Tooltip> |
||||
} |
||||
> |
||||
{children} |
||||
</OverlayTrigger> |
||||
</Fragment> |
||||
) |
||||
} |
@ -0,0 +1,10 @@ |
||||
import { ReactNode } from "react" |
||||
import { Placement } from "react-bootstrap/esm/Overlay" |
||||
|
||||
export type CustomTooltipType = { |
||||
children: ReactNode, |
||||
placement?: Placement, |
||||
tooltipId?: string, |
||||
tooltipClasses?:string, |
||||
tooltipText: string |
||||
} |
Loading…
Reference in new issue