function chooseIconByTxt(txt) {
    if (!txt) return () => {};
    txt = txt.toLowerCase();
    if (txt.includes("thunderstorm")) return drawThunderstorm;
    if (txt.includes("freezing")||txt.includes("snow")||
      txt.includes("sleet")) {
      return drawSnow;
    }
    if (txt.includes("drizzle")||
      txt.includes("shower")) {
      return drawRain;
    }
    if (txt.includes("rain")) return drawShowerRain;
    if (txt.includes("clear")) return drawSun;
    if (txt.includes("few clouds")) return drawFewClouds;
    if (txt.includes("scattered clouds")) return drawCloud;
    if (txt.includes("clouds")) return drawBrokenClouds;
    if (txt.includes("mist") ||
      txt.includes("smoke") ||
      txt.includes("haze") ||
      txt.includes("sand") ||
      txt.includes("dust") ||
      txt.includes("fog") ||
      txt.includes("ash") ||
      txt.includes("squalls") ||
      txt.includes("tornado")) {
      return drawMist;
    }
    return drawUnknown;
  }
/*
  * Choose weather icon to display based on weather description
  */
Choose weather icon to display based on weather description
Choose weather icon to display based on weather description
function chooseIconByTxt(txt) {
    if (!txt) return () => {};
    txt = txt.toLowerCase();
    if (txt.includes("thunderstorm")) return drawThunderstorm;
    if (txt.includes("freezing")||txt.includes("snow")||
      txt.includes("sleet")) {
      return drawSnow;
    }
    if (txt.includes("drizzle")||
      txt.includes("shower")) {
      return drawRain;
    }
    if (txt.includes("rain")) return drawShowerRain;
    if (txt.includes("clear")) return drawSun;
    if (txt.includes("few clouds")) return drawFewClouds;
    if (txt.includes("scattered clouds")) return drawCloud;
    if (txt.includes("clouds")) return drawBrokenClouds;
    if (txt.includes("mist") ||
      txt.includes("smoke") ||
      txt.includes("haze") ||
      txt.includes("sand") ||
      txt.includes("dust") ||
      txt.includes("fog") ||
      txt.includes("ash") ||
      txt.includes("squalls") ||
      txt.includes("tornado")) {
      return drawMist;
    }
    return drawUnknown;
  }
function chooseIconByTxt ( txt ) { if ( ! txt ) return ( ) => { } ; txt = txt . toLowerCase ( ) ; if ( txt . includes ( "thunderstorm" ) ) return drawThunderstorm ; if ( txt . includes ( "freezing" ) || txt . includes ( "snow" ) || txt . includes ( "sleet" ) ) { return drawSnow ; } if ( txt . includes ( "drizzle" ) || txt . includes ( "shower" ) ) { return drawRain ; } if ( txt . includes ( "rain" ) ) return drawShowerRain ; if ( txt . includes ( "clear" ) ) return drawSun ; if ( txt . includes ( "few clouds" ) ) return drawFewClouds ; if ( txt . includes ( "scattered clouds" ) ) return drawCloud ; if ( txt . includes ( "clouds" ) ) return drawBrokenClouds ; if ( txt . includes ( "mist" ) || txt . includes ( "smoke" ) || txt . includes ( "haze" ) || txt . includes ( "sand" ) || txt . includes ( "dust" ) || txt . includes ( "fog" ) || txt . includes ( "ash" ) || txt . includes ( "squalls" ) || txt . includes ( "tornado" ) ) { return drawMist ; } return drawUnknown ; }
Choose weather icon to display based on weather description
Choose weather icon to display based on weather description