feat: show local weather warnings on dashboard
This commit is contained in:
@@ -8,7 +8,7 @@ import { EmptyState } from "@/components/states/empty-state";
|
||||
import { ErrorState } from "@/components/states/error-state";
|
||||
import { DEFAULT_STATION_ID } from "@/lib/constants";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
import { formatProvinceName, getProvinceForStation, normalizeProvinceName } from "@/lib/provinces";
|
||||
import { formatProvinceName, getProvinceForSelection } from "@/lib/provinces";
|
||||
import { useWeatherStore } from "@/lib/store";
|
||||
import type { WeatherWarning } from "@/types/imgw";
|
||||
|
||||
@@ -29,8 +29,7 @@ export function WarningsPanel() {
|
||||
if (isError) return <ErrorState onRetry={() => refetch()} description={t("warnings.error")} />;
|
||||
if (!warnings?.length) return <EmptyState title={t("warnings.emptyTitle")} description={t("warnings.emptyDescription")} />;
|
||||
|
||||
const province = normalizeProvinceName(selectedLocation?.province)
|
||||
?? getProvinceForStation(selectedStationId ?? DEFAULT_STATION_ID);
|
||||
const province = getProvinceForSelection(selectedLocation?.province, selectedStationId ?? DEFAULT_STATION_ID);
|
||||
if (!province) return <WarningGrid warnings={warnings} />;
|
||||
|
||||
const provinceLabel = formatProvinceName(province, language);
|
||||
|
||||
Reference in New Issue
Block a user