brightyui
Version:
Brighty UI library
20 lines • 1.11 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import styles from '../../../src/styles/Tag.module.scss';
import { EColors } from '../../types/EColors';
import Typography from '../Typography/Typography';
import { CloseIcon } from '../../images/IconComponents/CloseIcon';
import { cnb } from 'cnbuilder';
var Tag = function (_a) {
var _b;
var title = _a.title, onClick = _a.onClick, showCloseButton = _a.showCloseButton, icon = _a.icon, _c = _a.color, color = _c === void 0 ? EColors.fill3 : _c;
var handleClick = function () {
if (!showCloseButton) {
onClick();
}
};
return (_jsxs("div", { className: cnb(styles.root, (_b = {},
_b[styles.root__hover] = !showCloseButton,
_b)), onClick: handleClick, style: { background: color }, children: [icon, _jsx(Typography, { variant: 'captionMedium', color: EColors.white, children: title }), showCloseButton && (_jsx("div", { onClick: onClick, className: styles.close, children: _jsx(CloseIcon, { color: EColors.white }) }))] }));
};
export default Tag;
//# sourceMappingURL=Tag.js.map