eletrotupi / tcc/ commit / abb3e29

frontend: add mood & mood components constants

Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago abb3e29d1725b7efa1b00ff5c80e53bcf5d85da7 Browse files
Parents 67829b4
Changed files
2
Additions
+48
Deletions
0
/dev/null → frontend/constants/mood-components.ts
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 +
};
/dev/null → frontend/constants/moods.ts
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 +