| 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): string => {
|
| 24 | if (typeof value == 'number') {
|
| 25 | if (value == 1) return 'Suave';
|
| 26 | if (value <= 2) return 'Moderada';
|
| 27 | if (value <= 3) return 'Intensa';
|
| 28 | } else {
|
| 29 | if (value === 'LIGHT') return 'Suave';
|
| 30 | if (value === 'MODERATE') return 'Moderada';
|
| 31 | if (value === 'HIGH') return 'Intensa';
|
| 32 | }
|
| 33 | };
|
| 34 |
|
| 35 | export const intensityToValue = (value: number): string => {
|
| 36 | if (value == 1) return 'LIGHT';
|
| 37 | if (value <= 2) return 'MODERATE';
|
| 38 | if (value <= 3) return 'HIGH';
|
| 39 | }
|