#
vincentlu
2026-02-07 c65a357fc8b907af755e1ef6a2c201e31eb71e94
zy-acs-flow/src/page/loc/compDirect.js
@@ -1,21 +1,15 @@
const compDirectMap = {
    1: 'page.loc.enums.compDirect.left',
    2: 'page.loc.enums.compDirect.right',
    3: 'page.loc.enums.compDirect.forward',
};
export const compDirectChoices = [
    { id: 1, name: compDirectMap[1] },
    { id: 2, name: compDirectMap[2] },
    { id: 3, name: compDirectMap[3] },
    { id: 1, name: 'page.loc.enums.compDirect.left' },
    { id: 2, name: 'page.loc.enums.compDirect.right' },
    { id: 3, name: 'page.loc.enums.compDirect.forward' },
];
export const getCompDirectLabel = (translate, compDirect, fallback = '-') => {
    const key = compDirectMap[compDirect];
    if (!key) {
    const choice = compDirectChoices.find((item) => item.id === compDirect);
    if (!choice) {
        return fallback;
    }
    return typeof translate === 'function'
        ? translate(key, { _: fallback })
        : key;
        ? translate(choice.name, { _: fallback })
        : choice.name;
};