* Add single viewport configuration * Multiple viewport configuration * Improve performance by using independent set methods * Add jump to slice command * Add context configuration * Cache panel visibility * Fix sync between vtk and cornerstone * Remove apis index * Add approach * Add loading to update volumes * Fix broken configuration * Bump vtk version * Use loading label * Update cy tests after vtk loading label changed * Remove loading for segs
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
import './LoadingIndicator.css';
|
|
|
|
import React, { PureComponent } from 'react';
|
|
import { withTranslation } from 'react-i18next';
|
|
import PropTypes from 'prop-types';
|
|
|
|
class LoadingIndicator extends PureComponent {
|
|
static propTypes = {
|
|
percentComplete: PropTypes.number.isRequired,
|
|
error: PropTypes.object,
|
|
};
|
|
|
|
static defaultProps = {
|
|
percentComplete: 0,
|
|
error: null,
|
|
};
|
|
|
|
render() {
|
|
let percComplete;
|
|
if (this.props.percentComplete && this.props.percentComplete !== 100) {
|
|
percComplete = `${this.props.percentComplete}%`;
|
|
}
|
|
|
|
return (
|
|
<React.Fragment>
|
|
{this.props.error ? (
|
|
<div className="imageViewerErrorLoadingIndicator loadingIndicator">
|
|
<div className="indicatorContents">
|
|
<h4>Error Loading Image</h4>
|
|
<p className="description">An error has occurred.</p>
|
|
<p className="details">{this.props.error.message}</p>
|
|
</div>
|
|
</div>
|
|
) : (
|
|
<div className="imageViewerLoadingIndicator loadingIndicator">
|
|
<div className="indicatorContents">
|
|
<p>
|
|
{this.props.t('Loading...')}
|
|
<i className="fa fa-spin fa-circle-o-notch fa-fw" />
|
|
{percComplete}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</React.Fragment>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default withTranslation('Common')(LoadingIndicator);
|