UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

36 lines (32 loc) 956 B
/** * MSKCC 2021, 2024 */ import React__default from 'react'; import PropTypes from 'prop-types'; import omit from 'lodash.omit'; import cx from 'classnames'; import { usePrefix } from '../../internal/usePrefix.js'; const TableRow = props => { const prefix = usePrefix(); // Remove unnecessary props if provided to this component, these are // only useful in `TableExpandRow` const className = cx(props.className, { [`${prefix}--data-table--selected`]: props.isSelected }); const cleanProps = { ...omit(props, ['ariaLabel', 'onExpand', 'isExpanded', 'isSelected']), className: className || undefined }; return /*#__PURE__*/React__default.createElement("tr", cleanProps); }; TableRow.propTypes = { /** * Specify an optional className to be applied to the container node */ className: PropTypes.string, /** * Specify if the row is selected */ isSelected: PropTypes.bool }; export { TableRow as default };