Skip to content

Commit 9c4e77f

Browse files
Fix: Globe3D.tsx type error
Fixed a TypeScript error in Globe3D.tsx where a string was assigned to a type that only accepts "server" or "client".
1 parent 3a8f4c4 commit 9c4e77f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/Globe3D.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { useEffect, useRef } from 'react';
32

43
const Globe3D = () => {
@@ -18,8 +17,8 @@ const Globe3D = () => {
1817
let rotationX = 0;
1918
let rotationY = 0;
2019

21-
// Major cities and their approximate coordinates
22-
const cities = [
20+
// Major cities and their approximate coordinates with proper typing
21+
const cities: Array<{ name: string; lat: number; lng: number; type: 'server' | 'client' }> = [
2322
{ name: 'New York', lat: 40.7128, lng: -74.0060, type: 'server' },
2423
{ name: 'London', lat: 51.5074, lng: -0.1278, type: 'server' },
2524
{ name: 'Tokyo', lat: 35.6762, lng: 139.6503, type: 'server' },
@@ -40,7 +39,7 @@ const Globe3D = () => {
4039
{ name: 'Berlin', lat: 52.5200, lng: 13.4050, type: 'server' },
4140
{ name: 'Paris', lat: 48.8566, lng: 2.3522, type: 'client' },
4241
{ name: 'Amsterdam', lat: 52.3676, lng: 4.9041, type: 'server' }
43-
];
42+
] as const;
4443

4544
const connections: Array<{
4645
from: number;

0 commit comments

Comments
 (0)