mirror of
https://github.com/apache/superset.git
synced 2026-04-10 11:55:24 +00:00
* [explore] improve metric(s) and groupby(s) controls - surface verbose_name, description & expression in controls - [table viz] surface verbose name in table header * Fixing tests * Addressing comments * Fixing tests (once more)
29 lines
787 B
JavaScript
29 lines
787 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
|
|
import { slugify } from '../modules/utils';
|
|
|
|
const propTypes = {
|
|
label: PropTypes.string.isRequired,
|
|
tooltip: PropTypes.string.isRequired,
|
|
icon: PropTypes.string,
|
|
className: PropTypes.string,
|
|
};
|
|
const defaultProps = {
|
|
icon: 'question-circle-o',
|
|
};
|
|
|
|
export default function InfoTooltipWithTrigger({ label, tooltip, icon, className }) {
|
|
return (
|
|
<OverlayTrigger
|
|
placement="right"
|
|
overlay={<Tooltip id={`${slugify(label)}-tooltip`}>{tooltip}</Tooltip>}
|
|
>
|
|
<i className={`fa fa-${icon} ${className}`} />
|
|
</OverlayTrigger>
|
|
);
|
|
}
|
|
|
|
InfoTooltipWithTrigger.propTypes = propTypes;
|
|
InfoTooltipWithTrigger.defaultProps = defaultProps;
|