Spaces:
Running
Running
Update frontend/src/pages/History.jsx
Browse files
frontend/src/pages/History.jsx
CHANGED
|
@@ -51,93 +51,6 @@ const toastSuccess = (msg) => {
|
|
| 51 |
};
|
| 52 |
|
| 53 |
const stageConfig = {
|
| 54 |
-
{
|
| 55 |
-
id: 1,
|
| 56 |
-
fileName: "Invoice_Acme_Corp_2024.pdf",
|
| 57 |
-
fileType: "PDF",
|
| 58 |
-
fileSize: "2.4 MB",
|
| 59 |
-
extractedAt: "2024-01-15T14:32:00",
|
| 60 |
-
status: "completed",
|
| 61 |
-
confidence: 98.5,
|
| 62 |
-
fieldsExtracted: 25,
|
| 63 |
-
totalTime: 2847,
|
| 64 |
-
stages: {
|
| 65 |
-
uploading: { time: 342, status: "completed", variation: "normal" },
|
| 66 |
-
aiAnalysis: { time: 1523, status: "completed", variation: "normal" },
|
| 67 |
-
dataExtraction: { time: 756, status: "completed", variation: "fast" },
|
| 68 |
-
outputRendering: { time: 226, status: "completed", variation: "normal" },
|
| 69 |
-
},
|
| 70 |
-
},
|
| 71 |
-
{
|
| 72 |
-
id: 2,
|
| 73 |
-
fileName: "Contract_Agreement_v2.docx",
|
| 74 |
-
fileType: "DOCX",
|
| 75 |
-
fileSize: "1.8 MB",
|
| 76 |
-
extractedAt: "2024-01-15T12:15:00",
|
| 77 |
-
status: "completed",
|
| 78 |
-
confidence: 96.2,
|
| 79 |
-
fieldsExtracted: 42,
|
| 80 |
-
totalTime: 3421,
|
| 81 |
-
stages: {
|
| 82 |
-
uploading: { time: 289, status: "completed", variation: "fast" },
|
| 83 |
-
aiAnalysis: { time: 2134, status: "completed", variation: "slow" },
|
| 84 |
-
dataExtraction: { time: 812, status: "completed", variation: "normal" },
|
| 85 |
-
outputRendering: { time: 186, status: "completed", variation: "fast" },
|
| 86 |
-
},
|
| 87 |
-
},
|
| 88 |
-
{
|
| 89 |
-
id: 3,
|
| 90 |
-
fileName: "Receipt_Amazon_Jan15.jpg",
|
| 91 |
-
fileType: "JPG",
|
| 92 |
-
fileSize: "856 KB",
|
| 93 |
-
extractedAt: "2024-01-15T10:45:00",
|
| 94 |
-
status: "completed",
|
| 95 |
-
confidence: 99.1,
|
| 96 |
-
fieldsExtracted: 12,
|
| 97 |
-
totalTime: 1893,
|
| 98 |
-
stages: {
|
| 99 |
-
uploading: { time: 156, status: "completed", variation: "fast" },
|
| 100 |
-
aiAnalysis: { time: 1245, status: "completed", variation: "normal" },
|
| 101 |
-
dataExtraction: { time: 367, status: "completed", variation: "fast" },
|
| 102 |
-
outputRendering: { time: 125, status: "completed", variation: "fast" },
|
| 103 |
-
},
|
| 104 |
-
},
|
| 105 |
-
{
|
| 106 |
-
id: 4,
|
| 107 |
-
fileName: "Financial_Report_Q4.xlsx",
|
| 108 |
-
fileType: "XLSX",
|
| 109 |
-
fileSize: "4.2 MB",
|
| 110 |
-
extractedAt: "2024-01-14T16:20:00",
|
| 111 |
-
status: "completed",
|
| 112 |
-
confidence: 94.8,
|
| 113 |
-
fieldsExtracted: 156,
|
| 114 |
-
totalTime: 5632,
|
| 115 |
-
stages: {
|
| 116 |
-
uploading: { time: 567, status: "completed", variation: "slow" },
|
| 117 |
-
aiAnalysis: { time: 3245, status: "completed", variation: "slow" },
|
| 118 |
-
dataExtraction: { time: 1456, status: "completed", variation: "slow" },
|
| 119 |
-
outputRendering: { time: 364, status: "completed", variation: "normal" },
|
| 120 |
-
},
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
id: 5,
|
| 124 |
-
fileName: "Scan_Document_001.png",
|
| 125 |
-
fileType: "PNG",
|
| 126 |
-
fileSize: "3.1 MB",
|
| 127 |
-
extractedAt: "2024-01-14T09:30:00",
|
| 128 |
-
status: "failed",
|
| 129 |
-
confidence: 0,
|
| 130 |
-
fieldsExtracted: 0,
|
| 131 |
-
totalTime: 2156,
|
| 132 |
-
stages: {
|
| 133 |
-
uploading: { time: 423, status: "completed", variation: "normal" },
|
| 134 |
-
aiAnalysis: { time: 1733, status: "failed", variation: "error" },
|
| 135 |
-
dataExtraction: { time: 0, status: "skipped", variation: "skipped" },
|
| 136 |
-
outputRendering: { time: 0, status: "skipped", variation: "skipped" },
|
| 137 |
-
},
|
| 138 |
-
errorMessage: "Unable to detect text in image. Image quality too low.",
|
| 139 |
-
},
|
| 140 |
-
]; // Keep for fallback/initial state
|
| 141 |
uploading: { label: "Uploading", icon: Upload, color: "blue" },
|
| 142 |
aiAnalysis: { label: "AI Analysis", icon: Cpu, color: "violet" },
|
| 143 |
dataExtraction: { label: "Data Extraction", icon: TableProperties, color: "emerald" },
|
|
@@ -901,8 +814,6 @@ export default function History() {
|
|
| 901 |
</AnimatePresence>
|
| 902 |
</motion.div>
|
| 903 |
))}
|
| 904 |
-
</div>
|
| 905 |
-
|
| 906 |
{filteredHistory.length === 0 && !error && (
|
| 907 |
<div className="text-center py-16">
|
| 908 |
<div className="h-20 w-20 mx-auto rounded-2xl bg-slate-100 flex items-center justify-center mb-4">
|
|
@@ -920,7 +831,7 @@ export default function History() {
|
|
| 920 |
)}
|
| 921 |
</div>
|
| 922 |
)}
|
| 923 |
-
|
| 924 |
)}
|
| 925 |
</div>
|
| 926 |
</div>
|
|
|
|
| 51 |
};
|
| 52 |
|
| 53 |
const stageConfig = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
uploading: { label: "Uploading", icon: Upload, color: "blue" },
|
| 55 |
aiAnalysis: { label: "AI Analysis", icon: Cpu, color: "violet" },
|
| 56 |
dataExtraction: { label: "Data Extraction", icon: TableProperties, color: "emerald" },
|
|
|
|
| 814 |
</AnimatePresence>
|
| 815 |
</motion.div>
|
| 816 |
))}
|
|
|
|
|
|
|
| 817 |
{filteredHistory.length === 0 && !error && (
|
| 818 |
<div className="text-center py-16">
|
| 819 |
<div className="h-20 w-20 mx-auto rounded-2xl bg-slate-100 flex items-center justify-center mb-4">
|
|
|
|
| 831 |
)}
|
| 832 |
</div>
|
| 833 |
)}
|
| 834 |
+
</div>
|
| 835 |
)}
|
| 836 |
</div>
|
| 837 |
</div>
|