mirror of
https://github.com/apache/superset.git
synced 2026-04-12 20:57:55 +00:00
32 lines
924 B
JavaScript
32 lines
924 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
|
|
const propTypes = {
|
|
title: PropTypes.string.isRequired,
|
|
isSelected: PropTypes.bool.isRequired,
|
|
onSelect: PropTypes.func.isRequired,
|
|
info: PropTypes.string,
|
|
children: PropTypes.node.isRequired,
|
|
};
|
|
|
|
export default function PopoverSection({ title, isSelected, children, onSelect, info }) {
|
|
return (
|
|
<div className={'PopoverSection ' + (!isSelected ? 'dimmed' : '')}>
|
|
<div onClick={onSelect} className="pointer">
|
|
<strong>{title}</strong>
|
|
{info &&
|
|
<InfoTooltipWithTrigger
|
|
tooltip={info}
|
|
label="date-free-tooltip"
|
|
/>}
|
|
|
|
<i className={isSelected ? 'fa fa-check text-primary' : ''} />
|
|
</div>
|
|
<div>
|
|
{children}
|
|
</div>
|
|
</div>);
|
|
}
|
|
PopoverSection.propTypes = propTypes;
|