UNPKG

@talend/react-components

Version:
37 lines (36 loc) 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); var _Tag = _interopRequireDefault(require("../../Tag")); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * Cell renderer that displays a label */function CellLabel({ cellData, rowIndex }) { const label = typeof cellData === 'string' ? cellData : cellData === null || cellData === void 0 ? void 0 : cellData.label; return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, { id: `${rowIndex}`, bsStyle: (cellData === null || cellData === void 0 ? void 0 : cellData.style) || 'info', title: label, children: label }); } CellLabel.displayName = 'VirtualizedList(CellLabel)'; CellLabel.propTypes = { // The cell value : props.rowData[props.dataKey] cellData: _propTypes.default.oneOf([_propTypes.default.string, _propTypes.default.shape({ label: _propTypes.default.string, // the bootstrap style info, danger, warning, success style: _propTypes.default.string })]), // The collection item index. rowIndex: _propTypes.default.number }; var _default = exports.default = CellLabel; //# sourceMappingURL=CellLabel.component.js.map