1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| 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] },
| ];
|
| export const getCompDirectLabel = (translate, compDirect, fallback = '-') => {
| const key = compDirectMap[compDirect];
| if (!key) {
| return fallback;
| }
| return typeof translate === 'function'
| ? translate(key, { _: fallback })
| : key;
| };
|
|