frontend: add aux method to translate from slider => backend
Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago
cd9c2c3db91ac6b7e436fc3dc7d34aa8b1c42220 Browse filesParents
2454104Changed files
1
Additions
+6
Deletions
0
frontend/constants/mood-components.ts
1 1
export interface MoodComponentDefinition {
2 2
id: string;
3 3
label: string;
4 4
color: string;
5 5
}
23 23
export const intensityLabel = (value: number): string => {
24 24
if (value == 1) return 'Suave';
25 25
if (value <= 2) return 'Moderada';
26 26
if (value <= 3) return 'Intensa';
27 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 +
}