36 lines
1.8 KiB
JavaScript
36 lines
1.8 KiB
JavaScript
export const returnIcon = (index) => {
|
|
const icons = [
|
|
require('../assets/iqair1.png'),
|
|
require('../assets/iqair2.png'),
|
|
require('../assets/iqair3.png'),
|
|
require('../assets/iqair456.png'),
|
|
require('../assets/iqair456.png'),
|
|
require('../assets/iqair456.png'),
|
|
]
|
|
|
|
return icons[index];
|
|
}
|
|
|
|
export const returnStatus = (index) => {
|
|
const statuses = [
|
|
{title: "Good", body: "Air quality is satisfactory and poses little or no risk. Ventilating your car is recommended."},
|
|
{title: "Moderate", body: "Sensitive individuals should avoid outdoor activity as they may experience respiratory symptoms."},
|
|
{title: "Unhealthy for sensitive groups", body: "General public and sensitive individuals in particular are at risk to experience irritation and respiratory problem."},
|
|
{title: "Unhealthy", body: "Increase likelihood of adverse effects and aggravation to the heart and lungs among general public - particularly for sensitive groups."},
|
|
{title: "Very Unhealthy", body: "General public will be noticeably affected. Sensitive groups will experience reduced endurance in activities. These individuals should remain indoors and restrict activities."},
|
|
{title: "Hazardous", body: "General public and sensitive groups are at high risk to experience strong irritations and adverse health effects that could trigger other illnesses. Everyone should avoid exercise and remain indoors."}
|
|
];
|
|
|
|
return statuses[index]
|
|
}
|
|
|
|
export const returnStatusId = (num) => {
|
|
const value = parseInt(num);
|
|
|
|
if(value >= 1 && value <= 50) return 0;
|
|
if(value >= 51 && value <= 100) return 1;
|
|
if(value >= 101 && value <= 150) return 2;
|
|
if(value >= 151 && value <= 200) return 3;
|
|
if(value >= 201 && value <= 300) return 4;
|
|
if(value >= 301 && value <= 500) return 5;
|
|
} |