export const compDirectChoices = [ { 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 choice = compDirectChoices.find((item) => item.id === compDirect); if (!choice) { return fallback; } return typeof translate === 'function' ? translate(choice.name, { _: fallback }) : choice.name; };