改进METAR当日状态判断与展示

This commit is contained in:
2569718930@qq.com
2026-04-21 19:13:33 +08:00
parent 3901a9e967
commit 582ded8cfb
6 changed files with 230 additions and 84 deletions
@@ -366,6 +366,14 @@ export function HeroSummary() {
current.max_so_far != null &&
current.temp != null &&
current.max_so_far <= current.temp;
const currentObsText =
current.temp != null
? `${current.temp}${data.temp_symbol} @${current.obs_time || "--"}`
: data.metar_status?.stale_for_today
? locale === "en-US"
? "No same-day METAR"
: "今日暂无 METAR"
: "--";
return (
<section className="hero-section">
@@ -393,9 +401,7 @@ export function HeroSummary() {
{locale === "en-US" ? "Current Obs" : "当前实测"}
</span>
<span className="value">
{current.temp != null
? `${current.temp}${data.temp_symbol} @${current.obs_time || "--"}`
: "--"}
{currentObsText}
</span>
</div>
<div className="hero-item">