diff --git a/src/components/WeatherWidget.tsx b/src/components/WeatherWidget.tsx index a7ebcff..3ba0038 100644 --- a/src/components/WeatherWidget.tsx +++ b/src/components/WeatherWidget.tsx @@ -91,7 +91,7 @@ const WeatherWidget = () => { setData({ temperature: data.temperature, condition: data.condition, - location: location.city, + location: 'Mars', humidity: data.humidity, windSpeed: data.windSpeed, icon: data.icon, diff --git a/src/components/Widgets/Calculation.tsx b/src/components/Widgets/Calculation.tsx new file mode 100644 index 0000000..e671aab --- /dev/null +++ b/src/components/Widgets/Calculation.tsx @@ -0,0 +1,54 @@ +'use client'; + +import { Calculator, Equal } from 'lucide-react'; + +type CalculationWidgetProps = { + expression: string; + result: number; +}; + +const Calculation = ({ expression, result }: CalculationWidgetProps) => { + return ( +
+ {expression}
+
+ + Error: {props.error} +
++ {props.longName || props.shortName} +
+Weather data unavailable for {location}
++ {weatherInfo.description} +
++ {Math.round(daily.temperature_2m_max[0])}°{' '} + {Math.round(daily.temperature_2m_min[0])}° +
++ {new Date(current.time).toLocaleString('en-US', { + weekday: 'short', + hour: 'numeric', + minute: '2-digit', + })} +
+{day.day}
++ Wind +
++ {Math.round(current.wind_speed_10m)} km/h +
++ Humidity +
++ {Math.round(current.relative_humidity_2m)}% +
++ Feels Like +
++ {Math.round(current.apparent_temperature)}°C +
+