UNPKG

@talend/react-components

Version:
32 lines (31 loc) 987 B
import PropTypes from 'prop-types'; import Tag from '../../Tag'; /** * Cell renderer that displays a label */ import { jsx as _jsx } from "react/jsx-runtime"; function CellLabel({ cellData, rowIndex }) { const label = typeof cellData === 'string' ? cellData : cellData === null || cellData === void 0 ? void 0 : cellData.label; return /*#__PURE__*/_jsx(Tag, { 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.oneOf([PropTypes.string, PropTypes.shape({ label: PropTypes.string, // the bootstrap style info, danger, warning, success style: PropTypes.string })]), // The collection item index. rowIndex: PropTypes.number }; export default CellLabel; //# sourceMappingURL=CellLabel.component.js.map