Fakultas Ilmu Komputer UI

index.ts 1.49 KB
Newer Older
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
import { DietProfilePageContent, answerTypes } from '../types';
import { getQuestionAnswerString } from '../utils';
import { DietQuestionnaireResponse } from 'services/dietQuestionnaire/models';
import { pageHeaders } from 'constants/questionnaire';

export const dailyFoodConsumption = ({
  breakfast_meal_explanation,
  morning_snack_explanation,
  lunch_meal_explanation,
  evening_snack_explanation,
  dinner_meal_explanation,
  night_snack_explanation,
}: DietQuestionnaireResponse): DietProfilePageContent => {
  const page = 'foodConsumption';
  return {
    title: pageHeaders[3],
    questions: [
      getQuestionAnswerString(
        page,
        'breakfast_meal_explanation',
        breakfast_meal_explanation,
        answerTypes.TEXT,
      ),
      getQuestionAnswerString(
        page,
        'morning_snack_explanation',
        morning_snack_explanation,
        answerTypes.TEXT,
      ),
      getQuestionAnswerString(
        page,
        'lunch_meal_explanation',
        lunch_meal_explanation,
        answerTypes.TEXT,
      ),
      getQuestionAnswerString(
        page,
        'evening_snack_explanation',
        evening_snack_explanation,
        answerTypes.TEXT,
      ),
      getQuestionAnswerString(
        page,
        'dinner_meal_explanation',
        dinner_meal_explanation,
        answerTypes.TEXT,
      ),
      getQuestionAnswerString(
        page,
        'night_snack_explanation',
        night_snack_explanation,
        answerTypes.TEXT,
      ),
    ],
  };
};