2020-04-02 16:58:18 -03:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import StudyListTableRow from './StudyListTableRow';
|
|
|
|
|
|
2023-07-19 09:41:47 -04:00
|
|
|
const StudyListTable = ({ tableDataSource, querying }) => {
|
2020-04-02 16:58:18 -03:00
|
|
|
return (
|
2020-05-13 00:30:33 -04:00
|
|
|
<div className="bg-black">
|
2023-09-01 16:19:39 -04:00
|
|
|
<div className="container relative m-auto">
|
2020-05-13 00:30:33 -04:00
|
|
|
<table className="w-full text-white">
|
2023-09-01 16:19:39 -04:00
|
|
|
<tbody
|
|
|
|
|
data-cy="study-list-results"
|
|
|
|
|
data-querying={querying}
|
|
|
|
|
>
|
2020-05-13 00:30:33 -04:00
|
|
|
{tableDataSource.map((tableData, i) => {
|
2023-09-01 16:19:39 -04:00
|
|
|
return (
|
|
|
|
|
<StudyListTableRow
|
|
|
|
|
tableData={tableData}
|
|
|
|
|
key={i}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2020-05-13 00:30:33 -04:00
|
|
|
})}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2020-04-02 16:58:18 -03:00
|
|
|
</div>
|
2020-05-13 00:30:33 -04:00
|
|
|
</div>
|
2020-04-02 16:58:18 -03:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StudyListTable.propTypes = {
|
|
|
|
|
tableDataSource: PropTypes.arrayOf(
|
|
|
|
|
PropTypes.shape({
|
|
|
|
|
row: PropTypes.array.isRequired,
|
|
|
|
|
expandedContent: PropTypes.node.isRequired,
|
2023-07-19 09:41:47 -04:00
|
|
|
querying: PropTypes.bool,
|
2020-04-02 16:58:18 -03:00
|
|
|
onClickRow: PropTypes.func.isRequired,
|
|
|
|
|
isExpanded: PropTypes.bool.isRequired,
|
|
|
|
|
})
|
|
|
|
|
),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default StudyListTable;
|