github.com/grafana/pyroscope@v1.18.0/public/app/ui/Tooltip.tsx (about)

     1  import React from 'react';
     2  import MuiTooltip from '@mui/material/Tooltip';
     3  import styles from './Tooltip.module.scss';
     4  
     5  // Don't expose all props from the lib
     6  type AvailableProps = Pick<
     7    React.ComponentProps<typeof MuiTooltip>,
     8    'title' | 'children' | 'placement'
     9  >;
    10  function Tooltip(props: AvailableProps) {
    11    const defaultProps: Omit<
    12      React.ComponentProps<typeof MuiTooltip>,
    13      'title' | 'children'
    14    > = {
    15      arrow: true,
    16      classes: {
    17        tooltip: styles.muiTooltip,
    18        arrow: styles.muiTooltipArrow,
    19      },
    20    };
    21  
    22    /* eslint-disable-next-line react/jsx-props-no-spreading */
    23    return <MuiTooltip {...defaultProps} {...props} />;
    24  }
    25  
    26  export { Tooltip };