feat(grid): remove viewportIndex and only rely on viewportId (#3591)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
1 parent
5dafac7c92
commit
4c6ff873e8
83 files changed
+1309
-1123
No files matched your search
@@ -1,18 +1,40 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import LegacyViewportActionBar from '../LegacyViewportActionBar';
|
||||
import Notification from '../Notification';
|
||||
|
||||
const Viewport = ({
|
||||
interface StudyData {
|
||||
label: string;
|
||||
isTracked: boolean;
|
||||
isLocked: boolean;
|
||||
isRehydratable: boolean;
|
||||
studyDate: string;
|
||||
currentSeries: number;
|
||||
seriesDescription: string;
|
||||
modality: string;
|
||||
patientInformation: {
|
||||
patientName: string;
|
||||
patientSex: string;
|
||||
patientAge: string;
|
||||
MRN: string;
|
||||
thickness: string;
|
||||
spacing: string;
|
||||
scanner: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface ViewportProps {
|
||||
viewportId: string;
|
||||
onArrowsClick: () => void;
|
||||
studyData: StudyData;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const Viewport: React.FC<ViewportProps> = ({
|
||||
viewportId,
|
||||
viewportIndex,
|
||||
onArrowsClick,
|
||||
studyData,
|
||||
children,
|
||||
}) => {
|
||||
if (!viewportId) {
|
||||
viewportId = `viewport-${viewportIndex}`;
|
||||
}
|
||||
return (
|
||||
<div className="relative flex flex-col h-full">
|
||||
<div className="absolute top-0 left-0 w-full">
|
||||
@@ -58,30 +80,5 @@ const Viewport = ({
|
||||
);
|
||||
};
|
||||
|
||||
Viewport.propTypes = {
|
||||
viewportIndex: PropTypes.number.isRequired,
|
||||
onArrowsClick: PropTypes.func.isRequired,
|
||||
studyData: PropTypes.shape({
|
||||
label: PropTypes.string.isRequired,
|
||||
isTracked: PropTypes.bool.isRequired,
|
||||
/* Specific to SR Viewports only... */
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
isRehydratable: PropTypes.bool.isRequired,
|
||||
studyDate: PropTypes.string.isRequired,
|
||||
currentSeries: PropTypes.number.isRequired,
|
||||
seriesDescription: PropTypes.string.isRequired,
|
||||
modality: PropTypes.string.isRequired,
|
||||
patientInformation: PropTypes.shape({
|
||||
patientName: PropTypes.string.isRequired,
|
||||
patientSex: PropTypes.string.isRequired,
|
||||
patientAge: PropTypes.string.isRequired,
|
||||
MRN: PropTypes.string.isRequired,
|
||||
thickness: PropTypes.string.isRequired,
|
||||
spacing: PropTypes.string.isRequired,
|
||||
scanner: PropTypes.string.isRequired,
|
||||
}),
|
||||
}).isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export default Viewport;
|
||||
export type { ViewportProps, StudyData };
|
||||
@@ -1,2 +0,0 @@
|
||||
import Viewport from './Viewport';
|
||||
export default Viewport;
|
||||
@@ -0,0 +1,5 @@
|
||||
import Viewport from './Viewport';
|
||||
import type { StudyData, ViewportProps } from './Viewport';
|
||||
|
||||
export default Viewport;
|
||||
export type { StudyData, ViewportProps };
|
||||
Reference in new issue
Block a user