diff --git a/src/Components/Printing/JobStatus.js b/src/Components/Printing/JobStatus.js index 55f01a581..2759082b0 100644 --- a/src/Components/Printing/JobStatus.js +++ b/src/Components/Printing/JobStatus.js @@ -1,13 +1,52 @@ -import React from 'react'; +export default function JobStatus({ id, status, fileName }) { + const getStatusConfig = () => { + switch (status) { + case 'failed': + return { + color: 'alert-error', + icon: , + loading: false + }; + case 'completed': + return { + color: 'alert-success', + icon: , + loading: false + }; + default: // 'created', 'processing', etc. + return { + color: 'alert-info', + icon: null, // We'll use a spinner instead + loading: true + }; + } + }; + + const config = getStatusConfig(); -export default function JobStatus(props) { return ( -
-
- - - -

{props.fileName} ({props.id}): {props.status}

+
+
+ {config.loading ? ( + + ) : ( + + {config.icon} + + )} + +
+ + {fileName} + + Job ID: {id} +
+ +
+
+ {status} +
+
);