Files
wtr/components/forecast/forecast-sources.tsx
zv ee55521803
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s
chore: add prettier formatting
2026-06-14 20:26:56 +02:00

39 lines
1.2 KiB
TypeScript

"use client";
import { ExternalLink } from "lucide-react";
import { useI18n } from "@/lib/i18n";
import type { ForecastSource } from "@/types/forecast";
export function ForecastSources({ sources }: { sources: ForecastSource[] }) {
const { t } = useI18n();
const hasImgw = sources.includes("imgw-alaro");
return (
<p className="text-[0.68rem] leading-5 text-muted">
{t("forecast.source")}{" "}
{hasImgw && (
<>
<a
href="https://meteo.imgw.pl/pogoda/"
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-1 underline decoration-muted/60 underline-offset-2 transition hover:text-accent"
>
IMGW ALARO <ExternalLink className="size-3" />
</a>
{", "}
</>
)}
<a
href="https://open-meteo.com/"
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-1 underline decoration-muted/60 underline-offset-2 transition hover:text-accent"
>
Open-Meteo <ExternalLink className="size-3" />
</a>
. {t(hasImgw ? "forecast.sourceCombinedDescription" : "forecast.sourceFallbackDescription")}
</p>
);
}