import React from 'react' import { Popover, PopoverProps } from './Popover' import { Scale, useScale } from './Scale' const POPOVER_PROPS = { style: { fontSize: 12 } } type TooltipProps = Partial & { popoverTheme?: string label: React.ReactNode | string } const defaultOnClick = e => { e.stopPropagation() console.log('no click on tooltip') } export const Tooltip = ({ popoverTheme = 'tooltip', onClick = defaultOnClick, disabled = false, label, children, ...props }) => { const scale = useScale() if (disabled || !label) { return children as any } return ( {children} ) : ( children ) } {...props} > {label} ) }