fix: type errors (#3)
Co-authored-by: terraputix <terraputix@mailbox.org> Reviewed-on: useweb/open-meteo-blue#3
This commit was merged in pull request #3.
This commit is contained in:
@@ -16,9 +16,16 @@
|
||||
|
||||
let { children }: Props = $props();
|
||||
|
||||
interface CurrentWeather {
|
||||
current: {
|
||||
temperature_2m: number;
|
||||
weather_code: number;
|
||||
};
|
||||
}
|
||||
|
||||
let location = $state(get(storedLocation));
|
||||
let mounted = $state(false);
|
||||
let currentWeather = $state(null);
|
||||
let currentWeather = $state<CurrentWeather | null>(null);
|
||||
|
||||
// Subscribe to location changes
|
||||
storedLocation.subscribe((value) => {
|
||||
@@ -47,8 +54,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
const getWeatherIcon = (code) => {
|
||||
const iconMap = {
|
||||
const getWeatherIcon = (code: number): string => {
|
||||
const iconMap: Record<number, string> = {
|
||||
0: '☀️',
|
||||
1: '🌤️',
|
||||
2: '⛅',
|
||||
|
||||
Reference in New Issue
Block a user