Skip to content

Commit 81575ce

Browse files
authored
Merge pull request #2109 from tekdi/feat-yn-unit-test
Feat yn unit test
2 parents 9c13a06 + d3b5659 commit 81575ce

File tree

53 files changed

+16115
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+16115
-28
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React from 'react';
2+
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
3+
import PendingIcon from '@mui/icons-material/Pending';
4+
import CancelIcon from '@mui/icons-material/Cancel';
5+
import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty';
6+
7+
// Status icon mapping
8+
export const getStatusIcon = (status: string) => {
9+
switch (status) {
10+
case 'completed':
11+
return <CheckCircleIcon sx={{ color: '#1A8825', fontSize: 20 }} />;
12+
case 'pending':
13+
return <PendingIcon sx={{ color: '#FFC107', fontSize: 20 }} />;
14+
case 'processing':
15+
return <HourglassEmptyIcon sx={{ color: '#2196F3', fontSize: 20 }} />;
16+
case 'not_started':
17+
return <CancelIcon sx={{ color: '#757575', fontSize: 20 }} />;
18+
default:
19+
return <CancelIcon sx={{ color: '#757575', fontSize: 20 }} />;
20+
}
21+
};
22+
23+
// Status label mapping
24+
export const getStatusLabel = (status: string) => {
25+
switch (status) {
26+
case 'Completed':
27+
return 'Completed';
28+
case 'Image_Uploaded':
29+
return 'Image Uploaded';
30+
case 'AI Pending':
31+
return 'AI Processing Pending';
32+
case 'AI Processed':
33+
return 'AI Processed - Awaiting Approval';
34+
case 'Approved':
35+
return 'Approved';
36+
case 'Not Started':
37+
return 'Not Started';
38+
default:
39+
return status || 'Not Started';
40+
}
41+
};
42+
43+
// Map answer sheet status to internal status
44+
export const mapAnswerSheetStatusToInternalStatus = (status: string): string => {
45+
const statusMap: Record<string, string> = {
46+
'Completed': 'completed',
47+
'Image_Uploaded': 'pending',
48+
'AI Pending': 'processing',
49+
'AI Processed': 'processing',
50+
'Approved': 'completed',
51+
'Not Started': 'not_started',
52+
};
53+
54+
return statusMap[status] || 'not_started';
55+
};
56+

0 commit comments

Comments
 (0)