UNPKG

@talend/react-components

Version:
55 lines 1.43 kB
import PropTypes from 'prop-types'; import Inject from '../../Inject'; import { Action } from '../../Actions'; import { getTheme } from '../../theme'; import headerBarCssModule from '../HeaderBar.module.scss'; import { jsx as _jsx } from "react/jsx-runtime"; const theme = getTheme(headerBarCssModule); export function AppNotification({ getComponent, hasUnread, t, ...props }) { const className = theme('tc-header-bar-action', 'separated'); let icon; let label; if (hasUnread) { icon = 'talend-bell-notification'; label = t('HEADERBAR_NOTIFICATION_UNREAD', { defaultValue: 'Notifications (you have unread notifications)' }); } else { icon = 'talend-bell'; label = t('HEADERBAR_NOTIFICATION', { defaultValue: 'Notifications (you have no unread notifications)' }); } const global = { bsStyle: 'link', hideLabel: true, icon, label, tooltipPlacement: 'bottom', ...props }; const Renderers = Inject.getAll(getComponent, { Action }); return /*#__PURE__*/_jsx("li", { role: "presentation", className: className, children: /*#__PURE__*/_jsx(Renderers.Action, { ...global }) }); } AppNotification.propTypes = { getComponent: PropTypes.func, hasUnread: PropTypes.bool, renderers: PropTypes.shape({ Action: PropTypes.func }), t: PropTypes.func.isRequired }; //# sourceMappingURL=AppNotification.component.js.map