Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
641 B

import * as Highlight from '../constants/Highlight';
export const NTP_INACTIVE = 0;
export const NTP_ACTIVE = 1;
export const isNtpActive = ntpStatus => ntpStatus && ntpStatus.status === NTP_ACTIVE;
export const ntpStatusHighlight = ntpStatus => {
switch (ntpStatus.status) {
case NTP_INACTIVE:
return Highlight.IDLE;
case NTP_ACTIVE:
return Highlight.SUCCESS;
default:
return Highlight.ERROR;
}
}
export const ntpStatus = ntpStatus => {
switch (ntpStatus.status) {
case NTP_INACTIVE:
return "Inactive";
case NTP_ACTIVE:
return "Active";
default:
return "Unknown";
}
}