Fakultas Ilmu Komputer UI

utils.ts 1.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const physicalActivity = [
  'Hampir tidak pernah olahraga dan/atau duduk lebih dari 9 jam perhari',
  'Jalan kaki santai',
  'Jalan kaki cepat',
  'Pemanasan',
  'Naik turun tangga',
  'Jogging',
  'Treadmill',
  'Senam Aerobic/cardio, Recovery/Scratching, Dance dll',
  'Latihan penguatan otot (strength workout, weight workout)',
  'Other',
];

export const getPhysicalActivity = (activity: number[]) => {
15
16
  let res = '';
  activity.map((act, i) =>
17
    i === activity.length - 1
18
19
      ? res.concat(`- ${physicalActivity[act - 1]}`)
      : res.concat(`- ${physicalActivity[act - 1]}\n`),
20
  );
21
  return res;
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
};

const timeForActivity = [
  '0 - 60 menit',
  '60 - 100 menit',
  '100 - 120 menit',
  '120 - 150 menit',
  '150 - 175 menit',
  '175 - 200 menit',
  '200 - 250 menit',
  'Lebih dari 250 menit',
];

export const getTimeForActivity = (time: number) => timeForActivity[time - 1];

const feeling = [
  'Rasanya mau menyerah saja',
  'Capek, susah, bosen, males, repot, sibuk',
  'Biasa aja, meski ada kendala tapi semua bisa diatur',
  'Lancar terus, semangat cukup stabil, gak ada masalah',
  'Super seneng, semangat banget, worry-free lah',
];

export const getFeeling = (f: number) => feeling[f - 1];