1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| 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;
| };
|
|