@talend/react-components
Version:
Set of react components.
51 lines • 1.42 kB
JavaScript
import PropTypes from 'prop-types';
import Inject from '../../Inject';
import Action from '../../Actions/Action';
import ActionDropdown from '../../Actions/ActionDropdown';
import { getTheme } from '../../theme';
import headerBarCssModule from '../HeaderBar.module.scss';
import { jsx as _jsx } from "react/jsx-runtime";
const theme = getTheme(headerBarCssModule);
export function Information({
getComponent,
t,
...props
}) {
const global = {
bsStyle: 'link',
icon: 'talend-info-circle',
label: t('HEADERBAR_INFO', {
defaultValue: 'Information'
}),
tooltipPlacement: 'bottom',
...props
};
const className = theme('tc-header-bar-action', 'separated');
const Renderers = Inject.getAll(getComponent, {
Action,
ActionDropdown
});
return /*#__PURE__*/_jsx("li", {
role: "presentation",
className: className,
children: props.items && props.items.length ? /*#__PURE__*/_jsx(Renderers.ActionDropdown, {
pullRight: true,
noCaret: true,
hideLabel: true,
...global
}) : /*#__PURE__*/_jsx(Renderers.Action, {
hideLabel: true,
...global
})
});
}
Information.propTypes = {
getComponent: PropTypes.func,
items: PropTypes.array,
renderers: PropTypes.shape({
ActionSplitDropdown: PropTypes.func,
Action: PropTypes.func
}),
t: PropTypes.func.isRequired
};
//# sourceMappingURL=Information.component.js.map