fix: show full city name with postal code and country in top villes

Restore full Cesium+ city field (including postal code), restructure
the city card so name wraps on two lines with country badge + tx count
+ volume all readable without truncation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
syoul
2026-03-22 18:55:37 +01:00
parent 55d2b50cd3
commit d99ad3707d
2 changed files with 18 additions and 16 deletions

View File

@@ -116,24 +116,26 @@ export function StatsPanel({ stats, loading, periodDays, source }: StatsPanelPro
{stats.topCities.map((city, i) => (
<div
key={city.name}
className="bg-[#0f1016] border border-[#2e2f3a] rounded-lg px-3 py-2.5 flex items-center gap-3"
className="bg-[#0f1016] border border-[#2e2f3a] rounded-lg px-3 py-2.5 flex gap-2.5"
>
<span className="text-base">{MEDALS[i]}</span>
<span className="text-base shrink-0 mt-0.5">{MEDALS[i]}</span>
<div className="flex-1 min-w-0">
<p className="text-white text-sm font-medium truncate flex items-center gap-1.5">
{city.countryCode && (
<span className="shrink-0 text-[10px] font-bold bg-[#1e1f2a] text-[#6b7280] rounded px-1 py-0.5 leading-none">
{city.countryCode}
</span>
)}
{city.name}
</p>
<p className="text-[#6b7280] text-xs">{city.count} tx</p>
<p className="text-white text-xs font-medium leading-snug">{city.name}</p>
<div className="flex items-center justify-between mt-1">
<span className="flex items-center gap-1.5 text-[#6b7280] text-xs">
{city.countryCode && (
<span className="text-[10px] font-bold bg-[#1e1f2a] text-[#6b7280] rounded px-1 py-0.5 leading-none">
{city.countryCode}
</span>
)}
{city.count} tx
</span>
<span className="text-[#d4a843] text-xs font-mono flex items-center gap-1">
{city.volume.toLocaleString('fr-FR', { maximumFractionDigits: 0 })} Ğ1
{delta(city.volume, prevCityVolume, city.name)}
</span>
</div>
</div>
<span className="text-[#d4a843] text-sm font-mono shrink-0 flex items-center gap-1">
{city.volume.toLocaleString('fr-FR', { maximumFractionDigits: 0 })} Ğ1
{delta(city.volume, prevCityVolume, city.name)}
</span>
</div>
))}
</div>

View File

@@ -129,7 +129,7 @@ export async function resolveGeoByKeys(
if (!geo) continue;
result.set(hit._id, {
name: src.title ?? '',
city: cleanCityName(src.city ?? 'Inconnue'),
city: src.city ?? 'Inconnue',
countryCode: latLngToCountryCode(geo.lat, geo.lng),
lat: geo.lat,
lng: geo.lng,