UNPKG

@talend/react-components

Version:
36 lines 1.13 kB
import PropTypes from 'prop-types'; import TooltipTrigger from '../../../TooltipTrigger'; import badgeCssModule from '../../Badge.module.scss'; import { getTheme } from '../../../theme'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const theme = getTheme(badgeCssModule); const BadgeLabel = ({ aslink, category, label, children }) => { const labelTextClasses = theme({ 'tc-badge-label-text': !(!aslink && category), 'tc-badge-label-text-with-categ': !aslink && category }); return /*#__PURE__*/_jsxs("div", { className: theme('tc-badge-label'), children: [/*#__PURE__*/_jsx(TooltipTrigger, { label: label, tooltipPlacement: "top", children: /*#__PURE__*/_jsx("span", { className: labelTextClasses, children: label }, "label") }), children] }); }; BadgeLabel.propTypes = { aslink: PropTypes.bool, category: PropTypes.string, label: PropTypes.string.isRequired, children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]) }; export default BadgeLabel; //# sourceMappingURL=BadgeLabel.component.js.map