Commit bcac76f2 authored by BharathTarento's avatar BharathTarento
Browse files

removed commented one and added constants in Lan

Showing with 14 additions and 29 deletions
+14 -29
......@@ -57,7 +57,14 @@ export const LANG = {
FORM_STATUS_TEXT: {
SENT_FOR_INSPECTION:"Sent for assessment",
INSPECTION_COMPLETED: "Assessment completed",
INSPECTOR_TOTAL_PENDING:"Assessment total pending",
UNDER_REVIEW:"Under review"
},
SEND_FOR_INSPECTION:"Send for assessment",
INSPECTOR_TOTAL_PENDING:"Assessment total pending"
METRIC_LABEL_KEY: {
UNDER_REVIEW:"Underreview",
SENT_FOR_INS:"Sentforins",
INS_COMPLETED:"Inscompleted",
INSPECTOR_TOTAL_PENDING:"Inspector total pending"
}
};
......@@ -18,17 +18,17 @@ export const formatLabel = (labelStatus: string) => {
let lowerLabel = labelStatus.toLowerCase();
lowerLabel = lowerLabel.charAt(0).toUpperCase() + lowerLabel.slice(1);
switch (lowerLabel) {
case "Underreview":
lowerLabel = "Under review";
case `${LANG.METRIC_LABEL_KEY.UNDER_REVIEW}`:
lowerLabel = `${LANG.FORM_STATUS_TEXT.UNDER_REVIEW}`;
return lowerLabel;
case "Sentforins":
case `${LANG.METRIC_LABEL_KEY.SENT_FOR_INS}`:
lowerLabel = `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`;
return lowerLabel;
case "Inscompleted":
case `${LANG.METRIC_LABEL_KEY.INS_COMPLETED}`:
lowerLabel = `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`;
return lowerLabel;
case "Inspector total pending":
lowerLabel = `${LANG.INSPECTOR_TOTAL_PENDING}`;
case `${LANG.METRIC_LABEL_KEY.INSPECTOR_TOTAL_PENDING}`:
lowerLabel = `${LANG.FORM_STATUS_TEXT.INSPECTOR_TOTAL_PENDING}`;
return lowerLabel;
default:
return lowerLabel;
......
......@@ -116,28 +116,6 @@ export const ReviewerHome = ({ data }: ReviewerProps) => {
);
};
// Function to format the status label
// const formatLabel = (labelStatus: string) => {
// let lowerLabel = labelStatus.toLowerCase();
// lowerLabel = lowerLabel.charAt(0).toUpperCase() + lowerLabel.slice(1);
// switch (lowerLabel) {
// case "Underreview":
// lowerLabel = "Under review";
// return lowerLabel;
// case "Sentforins":
// lowerLabel = `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`;
// return lowerLabel;
// case "Inscompleted":
// lowerLabel = `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`;
// return lowerLabel;
// case "Inspector total pending":
// lowerLabel = `${LANG.INSPECTOR_TOTAL_PENDING}`;
// return lowerLabel;
// default:
// return lowerLabel;
// }
// };
return (
<Fragment>
<div className="container-fluid">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment