/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { useSelector } from "react-redux"; function WeatherForecast() { const prefs = useSelector(state => state.Prefs.values); const weatherData = useSelector(state => state.Weather); const WEATHER_SUGGESTION = weatherData.suggestions?.[0]; const showDetailedView = prefs["weather.display"] === "detailed"; if (!showDetailedView || !weatherData?.initialized) { return null; } return (

{weatherData.locationData.city}

{ WEATHER_SUGGESTION.current_conditions.temperature[ prefs["weather.temperatureUnits"] ] } °{prefs["weather.temperatureUnits"]} {WEATHER_SUGGESTION.current_conditions.summary}
{ WEATHER_SUGGESTION.forecast.high[ prefs["weather.temperatureUnits"] ] } ° {WEATHER_SUGGESTION.forecast.low[prefs["weather.temperatureUnits"]]} °

); } export { WeatherForecast };