eletrotupi / tcc/ frontend/constants/mood-components.tsc74790e9b8565fd1c4db09f2743077a96c6abb36
1.2 KB | 33 lines Raw
1
export interface MoodComponentDefinition {
2
  id: string;
3
  label: string;
4
  color: string;
5
}
6

7
export const MOOD_COMPONENTS: MoodComponentDefinition[] = [
8
  { id: 'joy',       label: 'Alegria',       color: '#FBBF24' }, // amber
9
  { id: 'neutral',   label: 'Tranquilidade', color: '#60A5FA' }, // blue
10
  { id: 'anger',     label: 'Raiva',         color: '#F87171' }, // red
11
  { id: 'sadness',   label: 'Tristeza',      color: '#818CF8' }, // indigo
12
  { id: 'anxiety',   label: 'Ansiedade',     color: '#FB923C' }, // orange
13
  { id: 'gratitude', label: 'Gratidão',      color: '#C084FC' }, // purple
14
  { id: 'focus',     label: 'Foco',          color: '#34D399' }, // teal
15
  { id: 'tiredness', label: 'Cansaço',       color: '#94A3B8' }, // slate
16
];
17

18
// Lookup helper
19
export const getMoodComponent = (id: string) =>
20
  MOOD_COMPONENTS.find((c) => c.id === id);
21

22
// Intensity label buckets
23
export const intensityLabel = (value: number): string => {
24
  if (value == 1) return 'Suave';
25
  if (value <= 2) return 'Moderada';
26
  if (value <= 3) return 'Intensa';
27
};
28

29
export const intensityToValue = (value: number): string => {
30
  if (value == 1) return 'LIGHT';
31
  if (value <= 2) return 'MODERATE';
32
  if (value <= 3) return 'HIGH';
33
}