diff --git a/src/ReductionHistory.tsx b/src/ReductionHistory.tsx
index 8c540dc..af32d70 100644
--- a/src/ReductionHistory.tsx
+++ b/src/ReductionHistory.tsx
@@ -18,8 +18,13 @@ import {
InputLabel,
SelectChangeEvent,
Box,
+ Tooltip,
styled,
} from '@mui/material';
+import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
+import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
+import HighlightOffIcon from '@mui/icons-material/HighlightOff';
+import WarningAmberIcon from '@mui/icons-material/WarningAmber';
import { instruments } from './InstrumentData';
interface Run {
@@ -135,33 +140,48 @@ const ReductionHistory: React.FC = () => {
return fileName;
};
- const formatReductionStatus = (status: string, statusMessage: string): string => {
- let formattedSatatus = status;
- if (status === 'NOT_STARTED') {
- formattedSatatus = 'NOT STARTED';
- }
-
- if (statusMessage && statusMessage.trim().length > 0) {
- formattedSatatus += ` - ${statusMessage}`;
- }
+ const ReductionStatusIcon = ({ state, statusMessage }: { state: string; statusMessage: string }): JSX.Element => {
+ let IconComponent;
+ let color;
- return formattedSatatus;
- };
-
- const getStatusColor = (state: string): string => {
switch (state) {
- case 'UNSUCCESSFUL':
case 'ERROR':
- return '#F88888'; // Light red background
+ IconComponent = ErrorOutlineIcon;
+ color = 'red';
+ break;
case 'SUCCESSFUL':
- return '#9BE19B'; // Light green background
+ IconComponent = CheckCircleOutlineIcon;
+ color = 'green';
+ break;
+ case 'UNSUCCESSFUL':
+ IconComponent = WarningAmberIcon;
+ color = 'orange';
+ break;
case 'NOT_STARTED':
- return '#F9F995'; // Light yellow background
+ IconComponent = HighlightOffIcon;
+ color = 'grey';
+ break;
default:
- return 'inherit'; // Default background color
+ IconComponent = ErrorOutlineIcon;
+ color = 'disabled';
+ statusMessage = 'Unknown status';
}
+ return (
+