ohif-viewer/extensions/dicom-html/src/ConnectedDicomHtmlViewport.js

34 lines
748 B
JavaScript
Raw Normal View History

import OHIF from '@ohif/core';
import { connect } from 'react-redux';
import DicomHtmlViewport from './DicomHtmlViewport';
const { setViewportActive } = OHIF.redux.actions;
const mapStateToProps = (state, ownProps) => {
const { viewportIndex, byteArray } = ownProps;
const activeViewportIndex = state.viewports;
return {
viewportIndex,
activeViewportIndex,
byteArray,
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
const { viewportIndex } = ownProps;
return {
setViewportActive: () => {
dispatch(setViewportActive(viewportIndex));
},
};
};
const ConnectedDicomHtmlViewport = connect(
mapStateToProps,
mapDispatchToProps
)(DicomHtmlViewport);
export default ConnectedDicomHtmlViewport;