-
{getWeatherIcon(c.weatherCode, c.isDay)}
-
{Math.round(c.temperature)}°
-
- {getWeatherLabel(c.weatherCode)}
- {data.location.name}
-
-
- {#each data.alerts.slice(0, 2) as alert (alert.id)}
-
- ⚠ {alert.event}
-
- {/each}
+ {#if activeTab === 'compare' && selectedLat != null && selectedLon != null}
+
+ {:else if weatherStore.loading && !weatherStore.weatherData}
+
+ 🌤
+ Wetterdaten werden geladen...
- {/if}
+ {:else if weatherStore.error && !weatherStore.weatherData}
+
{weatherStore.error}
+ {:else if weatherStore.weatherData}
+ {@const data = weatherStore.weatherData}
-
- {#if data.hourly.length > 0}
-
- {#each data.hourly.slice(0, 8) as hour (hour.time)}
- {@const time = new Date(hour.time).toLocaleTimeString('de-DE', { hour: '2-digit' })}
-
- {time}
- {getWeatherIcon(hour.weatherCode, hour.isDay)}
- {Math.round(hour.temperature)}°
-
- {/each}
-
- {/if}
+
-
- {#if data.daily.length > 0}
-
- {#each data.daily.slice(0, 5) as day, idx (day.date)}
- {@const label =
- idx === 0
- ? 'Heute'
- : new Date(day.date).toLocaleDateString('de-DE', { weekday: 'short' })}
-
- {label}
- {getWeatherIcon(day.weatherCode)}
- {Math.round(day.temperatureMin)}° / {Math.round(day.temperatureMax)}°
-
- {/each}
-
- {/if}
+
-
- {#if weatherStore.nowcast}
-
- {weatherStore.nowcast.summary}
-
+ {#if weatherStore.nowcast}
+
+ {/if}
+
+ {#if data.hourly.length > 0}
+
+ {/if}
+
+ {#if data.daily.length > 0}
+
+ {/if}
+
+ {#if weatherStore.loading}
+
Aktualisierung...
+ {/if}
{/if}
-{:else if weatherStore.error}
-
{weatherStore.error}
-{/if}
+