@@ -15,6 +15,7 @@ import {
1515
1616import { type loader as locationAPI } from 'routes/api.locations.$location'
1717
18+ import { ClientOnly } from 'components/client-only'
1819import { LoadingLine } from 'components/loading-line'
1920import { Button } from 'components/ui/button'
2021import {
@@ -97,52 +98,54 @@ function Map({ className }: { className?: string }) {
9798 )
9899 return (
99100 < div className = { cn ( 'flex justify-center items-center' , className ) } >
100- < ComposableMap
101- className = 'object-scale-down max-w-full max-h-full'
102- projectionConfig = { { scale : 147 } }
103- width = { 800 }
104- height = { 400 }
105- >
106- < Sphere
107- id = 'sphere'
108- fill = 'transparent'
109- stroke = 'inherit'
110- className = 'stroke-gray-200 dark:stroke-gray-800'
111- strokeWidth = { 0.5 }
112- />
113- < Graticule
114- className = 'stroke-gray-200 dark:stroke-gray-800'
115- strokeWidth = { 0.5 }
116- />
117- < Geographies geography = { geography } >
118- { ( { geographies } ) =>
119- geographies . map ( ( geo ) => (
120- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
121- < Geography
122- key = { ( geo as { rsmKey : string } ) . rsmKey }
123- geography = { geo }
124- className = 'fill-gray-900 dark:fill-gray-100'
125- />
126- /* eslint-enable @typescript-eslint/no-unsafe-assignment */
127- ) )
128- }
129- </ Geographies >
130- { Object . entries ( LOCATION_TO_COORDINATES ) . map (
131- ( [ location , coordinates ] ) => {
132- const stats = counts . find ( ( c ) => c . location === location )
133- if ( stats == null || ! hasLocation ( stats ) ) return null
134- const radius = scale ( stats . showsCount )
135- return (
136- < LocationMarker
137- key = { location }
138- stats = { stats }
139- radius = { radius }
140- coordinates = { coordinates }
141- />
142- )
143- } ,
144- ) }
145- </ ComposableMap >
101+ < ClientOnly >
102+ < ComposableMap
103+ className = 'object-scale-down max-w-full max-h-full'
104+ projectionConfig = { { scale : 147 } }
105+ width = { 800 }
106+ height = { 400 }
107+ >
108+ < Sphere
109+ id = 'sphere'
110+ fill = 'transparent'
111+ stroke = 'inherit'
112+ className = 'stroke-gray-200 dark:stroke-gray-800'
113+ strokeWidth = { 0.5 }
114+ />
115+ < Graticule
116+ className = 'stroke-gray-200 dark:stroke-gray-800'
117+ strokeWidth = { 0.5 }
118+ />
119+ < Geographies geography = { geography } >
120+ { ( { geographies } ) =>
121+ geographies . map ( ( geo ) => (
122+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
123+ < Geography
124+ key = { ( geo as { rsmKey : string } ) . rsmKey }
125+ geography = { geo }
126+ className = 'fill-gray-900 dark:fill-gray-100'
127+ />
128+ /* eslint-enable @typescript-eslint/no-unsafe-assignment */
129+ ) )
130+ }
131+ </ Geographies >
132+ { Object . entries ( LOCATION_TO_COORDINATES ) . map (
133+ ( [ location , coordinates ] ) => {
134+ const stats = counts . find ( ( c ) => c . location === location )
135+ if ( stats == null || ! hasLocation ( stats ) ) return null
136+ const radius = scale ( stats . showsCount )
137+ return (
138+ < LocationMarker
139+ key = { location }
140+ stats = { stats }
141+ radius = { radius }
142+ coordinates = { coordinates }
143+ />
144+ )
145+ } ,
146+ ) }
147+ </ ComposableMap >
148+ </ ClientOnly >
146149 </ div >
147150 )
148151}
0 commit comments