From 30518a0fba4f645f10e1b89e55cba64763d146a1 Mon Sep 17 00:00:00 2001 From: christian Date: Fri, 10 May 2024 11:50:14 +0200 Subject: [PATCH] weathericon --- components/WeatherIcon.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/WeatherIcon.tsx b/components/WeatherIcon.tsx index ae32b51..410f5c8 100644 --- a/components/WeatherIcon.tsx +++ b/components/WeatherIcon.tsx @@ -17,8 +17,7 @@ import { HourlyForecast } from "@/types/types"; -function getCurrentWeatherIcon(weather: HourlyForecast) { - const weatherCode = weather.current.weather_code; +function getCurrentWeatherIcon(weatherCode: number) { switch (weatherCode) { default: return sun; @@ -84,10 +83,11 @@ function getCurrentWeatherIcon(weather: HourlyForecast) { export default function WeatherIcon() { const { weather } = useContext(WeatherContext) + const weatherCode = weather.current.weather_code return( <> - Weather icon -

{weather.current.weather_code}

+ Weather icon + {console.log(weatherCode)} ) }; \ No newline at end of file