fix: replace emoji flags with text badges, clean city names from postal codes

Emoji flags render as boxes on Linux. Replace with a small FR/BE/CH
badge. Also strip postal codes from Cesium+ city names (e.g.
"Saint-Jean-de-Laur, 46260" → "Saint-Jean-de-Laur").

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

View File

@@ -1,6 +1,5 @@
import { useRef } from 'react';
import type { PeriodStats } from '../services/DataService';
import { countryCodeToFlag } from '../services/adapters/CesiumAdapter';
interface StatsPanelProps {
stats: PeriodStats | null;
@@ -121,8 +120,13 @@ export function StatsPanel({ stats, loading, periodDays, source }: StatsPanelPro
>
<span className="text-base">{MEDALS[i]}</span>
<div className="flex-1 min-w-0">
<p className="text-white text-sm font-medium truncate">
{countryCodeToFlag(city.countryCode)}{city.countryCode ? ' ' : ''}{city.name}
<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>
</div>