feat: MeasurementsPanel API definition + content
This commit is contained in:
1 parent
8f566c7ef4
commit
a3f2080834
8 files changed
+148
-75
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { MeasurementTable } from '@ohif/ui';
|
||||
|
||||
const MeasurementsPanel = ({
|
||||
descriptionData,
|
||||
measurementTableData,
|
||||
actionButtons,
|
||||
}) => {
|
||||
const { date, modality, description } = descriptionData;
|
||||
return (
|
||||
<>
|
||||
<div className="overflow-y-auto overflow-x-hidden invisible-scrollbar">
|
||||
<div className="p-2">
|
||||
<div className="leading-none">
|
||||
<span className="text-white text-base mr-2">{date}</span>
|
||||
<span className="px-1 text-black bg-common-bright text-base rounded-sm font-bold">
|
||||
{modality}
|
||||
</span>
|
||||
</div>
|
||||
<div className="leading-none">
|
||||
<span className="text-base text-primary-light">{description}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MeasurementTable
|
||||
data={measurementTableData.data}
|
||||
title={measurementTableData.title}
|
||||
amount={measurementTableData.amount}
|
||||
onClick={measurementTableData.onClick}
|
||||
onEdit={measurementTableData.onEdit}
|
||||
/>
|
||||
</div>
|
||||
<div className="p-4 flex justify-center">{actionButtons}</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
MeasurementsPanel.defaultProps = {
|
||||
actionButtons: null,
|
||||
};
|
||||
|
||||
MeasurementsPanel.propTypes = {
|
||||
descriptionData: PropTypes.shape({
|
||||
date: PropTypes.string,
|
||||
modality: PropTypes.string,
|
||||
description: PropTypes.string,
|
||||
}).isRequired,
|
||||
measurementTableData: PropTypes.shape({
|
||||
title: PropTypes.string,
|
||||
amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
data: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
label: PropTypes.string,
|
||||
displayText: PropTypes.string,
|
||||
isActive: PropTypes.bool,
|
||||
})
|
||||
),
|
||||
onClick: PropTypes.func,
|
||||
onEdit: PropTypes.func,
|
||||
}).isRequired,
|
||||
actionButtons: PropTypes.node,
|
||||
};
|
||||
|
||||
export default MeasurementsPanel;
|
||||
Whitespace-only changes.
@@ -0,0 +1,2 @@
|
||||
import MeasurementsPanel from './MeasurementsPanel';
|
||||
export default MeasurementsPanel;
|
||||
Reference in new issue
Block a user