Spaces:
Sleeping
Sleeping
Update frontend/src/components/ocr/ProcessingStatus.jsx
Browse files
frontend/src/components/ocr/ProcessingStatus.jsx
CHANGED
|
@@ -16,11 +16,18 @@ const steps = [
|
|
| 16 |
{ id: "complete", label: "Done", icon: CheckCircle2 },
|
| 17 |
];
|
| 18 |
|
| 19 |
-
export default function ProcessingStatus({ isProcessing, isComplete }) {
|
| 20 |
const getCurrentStep = () => {
|
| 21 |
-
if (isComplete) return 4;
|
| 22 |
-
if (isProcessing) return
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
};
|
| 25 |
|
| 26 |
const currentStep = getCurrentStep();
|
|
|
|
| 16 |
{ id: "complete", label: "Done", icon: CheckCircle2 },
|
| 17 |
];
|
| 18 |
|
| 19 |
+
export default function ProcessingStatus({ isProcessing, isComplete, currentStage }) {
|
| 20 |
const getCurrentStep = () => {
|
| 21 |
+
if (isComplete) return 4; // Done
|
| 22 |
+
if (!isProcessing) return 0; // Not started
|
| 23 |
+
|
| 24 |
+
// Use provided currentStage or default based on isProcessing
|
| 25 |
+
if (currentStage === "extraction") return 3; // Extraction
|
| 26 |
+
if (currentStage === "analysis") return 2; // Analysis
|
| 27 |
+
if (currentStage === "received") return 1; // Received
|
| 28 |
+
|
| 29 |
+
// Default: if processing, start at Analysis
|
| 30 |
+
return 2; // Analysis
|
| 31 |
};
|
| 32 |
|
| 33 |
const currentStep = getCurrentStep();
|