feat: prefer IMGW ALARO forecast data
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
import { useEffect, useMemo, useRef } from "react";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { CloudSun, Droplets, ExternalLink, Sunrise, Sunset, Wind, X } from "lucide-react";
|
||||
import { CloudSun, Droplets, Sunrise, Sunset, Wind, X } from "lucide-react";
|
||||
import { DayForecastCharts } from "@/components/charts/day-forecast-charts";
|
||||
import { ForecastIcon } from "@/components/forecast/forecast-icon";
|
||||
import { ForecastSources } from "@/components/forecast/forecast-sources";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
getForecastCondition,
|
||||
isForecastHourPast,
|
||||
} from "@/lib/forecast-utils";
|
||||
import type { DailyForecast, HourlyForecast } from "@/types/forecast";
|
||||
import type { DailyForecast, ForecastSource, HourlyForecast } from "@/types/forecast";
|
||||
|
||||
function formatHour(value: string | null) {
|
||||
if (!value) return "—";
|
||||
@@ -43,11 +44,13 @@ export function DayForecastModal({
|
||||
day,
|
||||
hours,
|
||||
locationName,
|
||||
sources,
|
||||
onClose,
|
||||
}: {
|
||||
day: DailyForecast | null;
|
||||
hours: HourlyForecast[];
|
||||
locationName: string;
|
||||
sources: ForecastSource[];
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const { language, locale, t } = useI18n();
|
||||
@@ -169,12 +172,7 @@ export function DayForecastModal({
|
||||
|
||||
<DayForecastCharts hours={hours} />
|
||||
|
||||
<p className="text-[0.68rem] text-slate-500 dark:text-slate-400">
|
||||
{t("forecast.source")}{" "}
|
||||
<a href="https://open-meteo.com/" target="_blank" rel="noreferrer" className="inline-flex items-center gap-1 underline decoration-slate-400/60 underline-offset-2 transition hover:text-sky-700 dark:hover:text-sky-300">
|
||||
Open-Meteo <ExternalLink className="size-3" />
|
||||
</a>
|
||||
</p>
|
||||
<ForecastSources sources={sources} />
|
||||
</div>
|
||||
</motion.section>
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user