@@ -3,7 +3,6 @@ import { Globe } from "lucide-react";
33import { Stats } from "@/hooks/useWebSocket" ;
44import { ComposableMap , Geographies , Geography , ZoomableGroup } from "react-simple-maps" ;
55import { Tooltip as ReactTooltip } from "react-tooltip" ;
6- import { useState } from "react" ;
76
87interface GeoMapProps {
98 stats : Stats | null ;
@@ -55,7 +54,6 @@ const countryCodeMap: Record<string, string> = {
5554} ;
5655
5756export function GeoMap ( { stats } : GeoMapProps ) {
58- const [ hoveredCountry , setHoveredCountry ] = useState < string | null > ( null ) ;
5957 const hasCountryData = stats && stats . topCountries && stats . topCountries . length > 0 ;
6058
6159 // Create a map of country names/codes to request counts
@@ -101,7 +99,6 @@ export function GeoMap({ stats }: GeoMapProps) {
10199 </ CardDescription >
102100 </ CardHeader >
103101 < CardContent >
104- { /* Use Tailwind classes for the container */ }
105102 < div className = "w-full h-[400px]" >
106103 { ! stats ? (
107104 < div className = "h-full flex items-center justify-center text-muted-foreground" >
@@ -124,7 +121,6 @@ export function GeoMap({ stats }: GeoMapProps) {
124121 scale : 140 ,
125122 center : [ 0 , 20 ]
126123 } }
127- // Add style to make the map responsive
128124 style = { { width : '100%' , height : '100%' } }
129125 >
130126 < ZoomableGroup zoom = { 1 } minZoom = { 0.5 } maxZoom = { 8 } >
@@ -143,8 +139,6 @@ export function GeoMap({ stats }: GeoMapProps) {
143139 < Geography
144140 key = { geo . rsmKey }
145141 geography = { geo }
146- onMouseEnter = { ( ) => setHoveredCountry ( geo . rsmKey ) }
147- onMouseLeave = { ( ) => setHoveredCountry ( null ) }
148142 data-tooltip-id = "country-tooltip"
149143 data-tooltip-content = { `${ geoName } : ${ data . count . toLocaleString ( ) } requests` }
150144 style = { {
0 commit comments