UNPKG

brightyui

Version:

Brighty UI library

22 lines 1.5 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { cnb } from 'cnbuilder'; import styles from '../../../src/styles/BaseCell.module.scss'; var Wrapper = function (_a) { var wrapperRole = _a.wrapperRole, classNames = _a.classNames, children = _a.children, onClick = _a.onClick, disabled = _a.disabled; if (wrapperRole === 'default') { return _jsx("div", { className: classNames, children: children }); } return (_jsx("button", { onClick: onClick, disabled: disabled, className: classNames, children: children })); }; var BaseCell = function (_a) { var _b; var _c = _a.wrapperRole, wrapperRole = _c === void 0 ? 'button' : _c, leftSide = _a.leftSide, rightSide = _a.rightSide, title = _a.title, subtitle = _a.subtitle, onClick = _a.onClick, className = _a.className, disabled = _a.disabled, loading = _a.loading, reversed = _a.reversed; return (_jsxs(Wrapper, { classNames: cnb(styles.root, className, (_b = {}, _b[styles.root__disabled] = disabled, _b[styles.root__loading] = loading, _b[styles.root__noHover] = loading || wrapperRole === 'default', _b[styles.root__withSubtitle] = !!subtitle || leftSide, _b)), disabled: disabled, onClick: onClick, wrapperRole: wrapperRole, children: [leftSide, _jsxs("div", { className: cnb(styles.center, reversed && styles.reversed), children: [title, subtitle] }), rightSide] })); }; export default BaseCell; //# sourceMappingURL=BaseCell.js.map