Normalize Wunderground labels to METAR

This commit is contained in:
2569718930@qq.com
2026-04-22 23:43:27 +08:00
parent e3a9f7fb00
commit fe804bc915
8 changed files with 81 additions and 34 deletions
+10 -6
View File
@@ -17,6 +17,7 @@ import {
getRiskBadgeLabel,
getTemperatureChartData,
} from "@/lib/dashboard-utils";
import { normalizeObservationSourceLabel } from "@/lib/source-labels";
function DetailMiniTemperatureChart({ detail }: { detail: CityDetail }) {
const { locale, t } = useI18n();
@@ -178,17 +179,20 @@ export function DetailPanel() {
() => getTodayPolymarketUrl(detail, locale),
[detail, locale],
);
const basicSettlementLabel =
const basicSettlementLabel = normalizeObservationSourceLabel(
selectedSummary?.current?.settlement_source_label ||
selectedCityItem?.settlement_source_label ||
selectedCityItem?.settlement_source ||
(locale === "en-US" ? "Settlement source pending" : "结算口径待确认");
selectedCityItem?.settlement_source_label ||
selectedCityItem?.settlement_source,
locale === "en-US" ? "Settlement source pending" : "结算口径待确认",
);
const basicAirportLabel =
selectedCityItem?.airport ||
selectedSummary?.icao ||
(locale === "en-US" ? "Airport pending" : "机场待确认");
const heroSettlementLabel =
detail?.current?.settlement_source_label || basicSettlementLabel;
const heroSettlementLabel = normalizeObservationSourceLabel(
detail?.current?.settlement_source_label,
basicSettlementLabel,
);
const heroAirportLabel = detail?.risk?.airport || basicAirportLabel;
const isSparsePanelDetail = Boolean(
detail &&