From fc0e6a0a69f58f83ee10acd893bd85bf5fc82c22 Mon Sep 17 00:00:00 2001 From: knuthtimo-lab Date: Thu, 23 Apr 2026 14:52:13 +0200 Subject: [PATCH] npm run build --- src/components/analytics/GeoMap.tsx | 42 +++++++++++++++++------------ tsconfig.json | 21 ++++++++------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/components/analytics/GeoMap.tsx b/src/components/analytics/GeoMap.tsx index 31d42ed..3eb096c 100644 --- a/src/components/analytics/GeoMap.tsx +++ b/src/components/analytics/GeoMap.tsx @@ -120,12 +120,20 @@ interface CountryStat { percentage: number; } -interface GeoMapProps { - countryStats: CountryStat[]; - totalScans: number; -} - -const GeoMap: React.FC = ({ countryStats, totalScans }) => { +interface GeoMapProps { + countryStats: CountryStat[]; + totalScans: number; +} + +interface GeographyFeature { + id: string; + rsmKey: string; + properties: { + name: string; + }; +} + +const GeoMap: React.FC = ({ countryStats, totalScans }) => { // Build a map of ISO Alpha-3 codes to scan counts const countryData: Record = {}; let maxCount = 0; @@ -159,17 +167,17 @@ const GeoMap: React.FC = ({ countryStats, totalScans }) => { projectionConfig={{ scale: 120, center: [0, 30], - }} - style={{ width: '100%', height: '100%' }} - > - - - {({ geographies }) => - geographies.map((geo) => { - // geo.id is the numeric ISO code as a string (e.g., "840" for US) - const geoId = geo.id; - const scanCount = countryData[geoId] || 0; - const fillColor = scanCount > 0 ? colorScale(scanCount) : '#F1F5F9'; + }} + style={{ width: '100%', height: '100%' }} + > + + + {({ geographies }: { geographies: GeographyFeature[] }) => + geographies.map((geo: GeographyFeature) => { + // geo.id is the numeric ISO code as a string (e.g., "840" for US) + const geoId = geo.id; + const scanCount = countryData[geoId] || 0; + const fillColor = scanCount > 0 ? colorScale(scanCount) : '#F1F5F9'; return (