-
Notifications
You must be signed in to change notification settings - Fork 12
/
constants.ts
66 lines (60 loc) · 2.39 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { SelectOption } from './types/interfaces';
export const BRAND_OPTIONS: SelectOption[] = [
{ value: 'gmk', label: 'GMK' },
{ value: 'epbt', label: 'Enjoy PBT' },
{ value: 'jtk', label: 'JTK' },
{ value: 'sp', label: 'Signature Plastics' },
{ value: 'infinikey', label: 'Infinikey' },
{ value: 'keyreative', label: 'Keyreative' },
{ value: 'taihao', label: 'Tai-Hao' },
{ value: 'maxkey', label: 'MaxKey' },
{ value: 'zfrontier', label: 'zFrontier' },
{ value: 'leopold', label: 'Leopold' },
{ value: 'ducky', label: 'Ducky' },
];
export const MATERIAL_OPTIONS: SelectOption[] = [
{ value: 'abs', label: 'ABS' },
{ value: 'pbt', label: 'PBT' },
];
export const PROFILE_OPTIONS: SelectOption[] = [
{ label: 'Cherry', value: 'cherry' },
{ label: 'SA', value: 'sa' },
{ label: 'DSA', value: 'dsa' },
{ label: 'XDA', value: 'xda' },
{ label: 'MT3', value: 'mt3' },
{ label: 'KAT', value: 'kat' },
{ label: 'KAM', value: 'kam' },
{ label: 'OEM', value: 'oem' },
{ label: 'MDA', value: 'mda' },
{ label: 'DCS', value: 'dcs' },
];
export const NONE = 'none';
export const INTEREST_CHECK = 'ic';
export const WAITING_FOR_GROUPBUY = 'waiting';
export const IN_GROUP_BUY = 'gb';
export const ENDED = 'ended';
export const AVAILABILITY_OPTIONS: string[] = [NONE, INTEREST_CHECK, WAITING_FOR_GROUPBUY, IN_GROUP_BUY, ENDED];
export const AVAILABILITY_FILTER = 'availability';
export const BRAND_FILTER = 'brand';
export const MATERIAL_FILTER = 'material';
export const PROFILE_FILTER = 'profile';
export const CAP_FILTER = 'cap';
export const ALL_OPTIONS = [BRAND_OPTIONS, MATERIAL_OPTIONS, PROFILE_OPTIONS, AVAILABILITY_OPTIONS].reduce((accu, item, idx) => {
switch (idx) {
case 0:
accu.push((item as any).map((brand) => ({ ...brand, type: BRAND_FILTER })) as any);
break;
case 1:
accu.push((item as any).map((material) => ({ ...material, type: MATERIAL_FILTER })) as any);
break;
case 2:
accu.push((item as any).map((profile) => ({ ...profile, type: PROFILE_FILTER })) as any);
break;
case 3:
accu.push(
(item as any).map((availability) => ({ label: availability, value: availability, type: AVAILABILITY_FILTER })) as any
);
break;
}
return [].concat.apply([], accu) as any;
}, []);