package components import ( "fmt" "gitlab.unjx.de/flohoss/godash/services" ) func getIcon(icon string) string { switch icon { case "01d": return "icon-[bi--sun-fill]" case "01n": return "icon-[bi--moon-fill]" case "02d": return "icon-[bi--cloud-sun-fill]" case "02n": return "icon-[bi--cloud-moon-fill]" case "03d", "03n": return "icon-[bi--cloud-fill]" case "04d", "04n": return "icon-[bi--clouds-fill]" case "09d", "09n": return "icon-[bi--cloud-rain-heavy-fill]" case "10d", "10n": return "icon-[bi--cloud-drizzle-fill]" case "11d", "11n": return "icon-[bi--cloud-lightning-rain-fill]" case "13d", "13n": return "icon-[bi--cloud-snow-fill]" case "50d", "50n": return "icon-[bi--cloud-fog2-fill]" default: return "" } } templ Weather(weather *services.OpenWeather) {
{ fmt.Sprintf("%0.2f",weather.Temp) } { weather.Units }
{ weather.Description }
{ fmt.Sprintf("%d %%",weather.Humidity) }
}