import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import getGridWidthClass from '../../utils/getGridWidthClass'; import { Icons } from '@ohif/ui-next'; const StudyListTableRow = props => { const { tableData } = props; const { row, expandedContent, onClickRow, isExpanded, dataCY, clickableCY } = tableData; return ( <>
{row.map((cell, index) => { const { content, title, gridCol } = cell; return ( ); })} {isExpanded && ( )}
{index === 0 && (
{isExpanded ? ( ) : ( )}
)}
{content}
{expandedContent}
); }; StudyListTableRow.propTypes = { tableData: PropTypes.shape({ /** A table row represented by an array of "cell" objects */ row: PropTypes.arrayOf( PropTypes.shape({ key: PropTypes.string.isRequired, /** Optional content to render in row's cell */ content: PropTypes.node, /** Title attribute to use for provided content */ title: PropTypes.string, gridCol: PropTypes.number.isRequired, }) ).isRequired, expandedContent: PropTypes.node.isRequired, onClickRow: PropTypes.func.isRequired, isExpanded: PropTypes.bool.isRequired, dataCY: PropTypes.string, clickableCY: PropTypes.string, }), }; export default StudyListTableRow;