2026-04-28 09:43:20 +08:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import type { StatusTone } from "@/components/dashboard/scan-terminal/CityStatusTags";
|
|
|
|
|
|
|
|
|
|
export type DataFreshnessRow = {
|
|
|
|
|
label: string;
|
2026-05-10 17:33:15 +08:00
|
|
|
labelTitle?: string;
|
2026-04-28 09:43:20 +08:00
|
|
|
value: string;
|
|
|
|
|
tone: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function DataFreshnessBar({
|
|
|
|
|
aiStatusLabel,
|
|
|
|
|
aiStatusTone,
|
|
|
|
|
freshnessSeparator,
|
|
|
|
|
isEn,
|
|
|
|
|
rows,
|
|
|
|
|
}: {
|
|
|
|
|
aiStatusLabel: string;
|
|
|
|
|
aiStatusTone: StatusTone;
|
|
|
|
|
freshnessSeparator: string;
|
|
|
|
|
isEn: boolean;
|
|
|
|
|
rows: DataFreshnessRow[];
|
|
|
|
|
}) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="scan-ai-city-freshness" aria-label={isEn ? "Data freshness" : "数据新鲜度"}>
|
|
|
|
|
<strong>{isEn ? "Data freshness" : "数据新鲜度"}</strong>
|
|
|
|
|
{rows.map((freshness) => (
|
|
|
|
|
<span key={freshness.label} className={freshness.tone}>
|
2026-05-10 17:33:15 +08:00
|
|
|
<b title={freshness.labelTitle}>{freshness.label}{freshnessSeparator}</b>
|
2026-04-28 09:43:20 +08:00
|
|
|
<em>{freshness.value}</em>
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
<span className={aiStatusTone}>
|
|
|
|
|
<b>AI{freshnessSeparator}</b>
|
|
|
|
|
<em>{aiStatusLabel}</em>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|