import {getStatusTag} from "utils/statusUtils/Base";

const APPR = { color: "#1D8735", eng: "Success", cht: "成功" }       // was #22a13f
const REJT = { color: "#d9372b", eng: "Reject", cht: "拒絕" }        // unchanged
const CANC = { color: "#797674", eng: "Cancelled", cht: "取消" }     // was #8a8784
const INPR = { color: "#8F7200", eng: "In Progress", cht: "進行中" } // was #f5a83d
const DUPA = { color: "#797674", eng: "", cht: "" }                 // was #8a8784

export function getStatus_Cht(params) {
    let status = getStatus(params);
    return getStatusTag({color: status.color, text:status.cht })
}

export function getStatus_Eng(params) {
    let status = getStatus(params);
    return getStatusTag({color: status.color, text:status.eng })
}

function getStatus(params) {
    let status = params?.row?params.row.status:params;
    if(status == "APPR") return APPR;
    if(status == "REJT") return REJT;
    if(status == "CANC") return CANC;
    if(status == "INPR") return INPR;
    if(status == "PSTO") return CANC;
    if(status == "NOTF") return CANC;
    if(status == "PSER") return INPR;
    if(status == "FIER") return INPR;
    if(status == "DUPA") return DUPA;
    return INPR;
}

