eletrotupi / tcc/ frontend/constants/mood-components.ts11f22a75d9fc5f839720f7c0fada4359dcf1b9b5
1.8 KB | 46 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: "anger", label: "Raiva", color: "#F87171" }, // red
10
  { id: "sadness", label: "Tristeza", color: "#818CF8" }, // indigo
11
  { id: "fear", label: "Medo", color: "#F9A8D4" }, // pink
12
  { id: "guilt", label: "Culpa", color: "#FF6347" }, // tomato
13
  { id: "frustration", label: "Frustração", color: "#CD853F" }, // terracota
14
  // States
15
  { id: "calm", label: "Calmo", color: "#60A5FA" }, // blue
16
  { id: "motivated", label: "Motivado", color: "#FB923C" }, // orange
17
  { id: "tiredness", label: "Cansaço", color: "#94A3B8" }, // slate
18
  { id: "gratitude", label: "Gratidão", color: "#C084FC" }, // purple
19
  { id: "focus", label: "Foco", color: "#34D399" }, // teal
20
  { id: "restless", label: "Inquieto", color: "#9FCBAD" }, // light-green
21
  { id: "relaxed", label: "Relaxado", color: "#995F2F" }, // light-brown
22
  { id: "overwhelmed", label: "Sobrecarga", color: "#744577" }, // pastel purple
23
];
24

25
// Lookup helper
26
export const getMoodComponent = (id: string) =>
27
  MOOD_COMPONENTS.find((c) => c.id === id);
28

29
// Intensity label buckets
30
export const intensityLabel = (value: number | string): string => {
31
  if (typeof value == "number") {
32
    if (value == 1) return "Suave";
33
    if (value <= 2) return "Moderada";
34
    if (value <= 3) return "Intensa";
35
  } else {
36
    if (value === "LIGHT") return "Suave";
37
    if (value === "MODERATE") return "Moderada";
38
    if (value === "HIGH") return "Intensa";
39
  }
40
};
41

42
export const intensityToValue = (value: number): string => {
43
  if (value == 1) return "LIGHT";
44
  if (value <= 2) return "MODERATE";
45
  if (value <= 3) return "HIGH";
46
};