frontend: add mood & mood components constants
Parents:
67829b42 file(s) changed
- frontend/constants/mood-components.ts +29 -0
- frontend/constants/moods.ts +19 -0
frontend/constants/mood-components.ts
@@ -0,0 +1,29 @@
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 <= 2) return 'Muito Baixa';
25 + if (value <= 4) return 'Baixa';
26 + if (value <= 6) return 'Moderada';
27 + if (value <= 8) return 'Alta';
28 + return 'Muito Alta';
29 + };
frontend/constants/moods.ts
@@ -0,0 +1,19 @@
1 + // TODO: Keep these synchronized with the API
2 + export interface MoodDefinition {
3 + id: string;
4 + icon: string;
5 + label: string;
6 + };
7 +
8 + export const MOODS: MoodDefinition[] = [
9 + { id: 'sad', icon: '😢', label: 'Triste' },
10 + { id: 'neutral', icon: '😐', label: 'Neutro' },
11 + { id: 'good', icon: '😊', label: 'Bem' },
12 + { id: 'great', icon: '🤩', label: 'Ótimo' },
13 + { id: 'angry', icon: '😠', label: 'Irritado' },
14 + ];
15 +
16 + // Lookup helper
17 + export const getMood = (id: string) =>
18 + MOODS.find((c) => c.id === id);
19 +