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

  1. import * as Highlight from '../constants/Highlight';
  2. export const NTP_INACTIVE = 0;
  3. export const NTP_ACTIVE = 1;
  4. export const isNtpActive = ntpStatus => ntpStatus && ntpStatus.status === NTP_ACTIVE;
  5. export const ntpStatusHighlight = ntpStatus => {
  6. switch (ntpStatus.status) {
  7. case NTP_INACTIVE:
  8. return Highlight.IDLE;
  9. case NTP_ACTIVE:
  10. return Highlight.SUCCESS;
  11. default:
  12. return Highlight.ERROR;
  13. }
  14. }
  15. export const ntpStatus = ntpStatus => {
  16. switch (ntpStatus.status) {
  17. case NTP_INACTIVE:
  18. return "Inactive";
  19. case NTP_ACTIVE:
  20. return "Active";
  21. default:
  22. return "Unknown";
  23. }
  24. }