Add Tooltips for Mint Rule selection

This commit is contained in:
Serkan Reis
2023-03-07 10:33:59 +03:00
parent 278c989703
commit cf7f00f2ee
2 changed files with 41 additions and 29 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import { usePopper } from 'react-popper'
export interface TooltipProps extends ComponentProps<'div'> {
label: ReactNode
children: ReactElement
placement?: 'top' | 'bottom' | 'left' | 'right'
}
export const Tooltip = ({ label, children, ...props }: TooltipProps) => {
@@ -14,7 +15,7 @@ export const Tooltip = ({ label, children, ...props }: TooltipProps) => {
const [show, setShow] = useState(false)
const { styles, attributes } = usePopper(referenceElement, popperElement, {
placement: 'top',
placement: props.placement ? props.placement : 'top',
})
return (