Better training status
import React, {Component} from "react";
+import PropTypes from 'prop-types';
import {Link} from "react-router-dom";
import {
Accordion,
@@ -9,6 +10,7 @@ import {
Card,
Button,
Message,
+ Loader
} from "semantic-ui-react";
import {connect} from "react-redux";
import {withTranslation} from "react-i18next";
@@ -147,8 +149,7 @@ class ModelTrain extends Component {
);
})}
</Accordion>
- <p>{status}</p>
-
+ <StatusIndicator status={status} />
</div>
)}
</Message.Content>
@@ -195,6 +196,21 @@ class ModelTrain extends Component {
}
}
+function StatusIndicator({status}) {
+ if (status === 'training') {
+ return <Loader size="medium" text>Training</Loader>
+ }
+
+ return (
+ <p>{status}</p>
+ )
+}
+
+StatusIndicator.propTypes = {
+ status: PropTypes.string.isRequired,
+}
+
+
const mapStateToProps = (state) => {
return {
name: state.model.name,
