- Introduced FlightCard component for displaying flight information with animations. - Added ScrollArea component for custom scroll behavior. - Implemented StatusBar component to show flight count and loading status. - Created useFlights hook for fetching and managing flight data based on city selection. - Developed useSettings hook for managing user settings with local storage persistence. - Added useTrailHistory hook for managing flight trail data. - Defined City type and CITIES constant for city data management. - Implemented flight utility functions for altitude and speed conversions. - Created map styles for different visual representations. - Added OpenSky API integration for fetching flight data. - Implemented utility functions for class name merging. - Configured TypeScript settings for the project.
100 lines
1.7 KiB
TypeScript
100 lines
1.7 KiB
TypeScript
export type City = {
|
|
id: string;
|
|
name: string;
|
|
country: string;
|
|
iata: string;
|
|
coordinates: [longitude: number, latitude: number];
|
|
radius: number;
|
|
};
|
|
|
|
export const CITIES: City[] = [
|
|
{
|
|
id: "nyc",
|
|
name: "New York",
|
|
country: "US",
|
|
iata: "JFK",
|
|
coordinates: [-73.7781, 40.6413],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "lax",
|
|
name: "Los Angeles",
|
|
country: "US",
|
|
iata: "LAX",
|
|
coordinates: [-118.4085, 33.9416],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "lhr",
|
|
name: "London",
|
|
country: "GB",
|
|
iata: "LHR",
|
|
coordinates: [-0.4614, 51.47],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "dxb",
|
|
name: "Dubai",
|
|
country: "AE",
|
|
iata: "DXB",
|
|
coordinates: [55.3644, 25.2532],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "nrt",
|
|
name: "Tokyo",
|
|
country: "JP",
|
|
iata: "NRT",
|
|
coordinates: [140.3929, 35.772],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "sin",
|
|
name: "Singapore",
|
|
country: "SG",
|
|
iata: "SIN",
|
|
coordinates: [103.9915, 1.3644],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "cdg",
|
|
name: "Paris",
|
|
country: "FR",
|
|
iata: "CDG",
|
|
coordinates: [2.5479, 49.0097],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "sfo",
|
|
name: "San Francisco",
|
|
country: "US",
|
|
iata: "SFO",
|
|
coordinates: [-122.379, 37.6213],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "ord",
|
|
name: "Chicago",
|
|
country: "US",
|
|
iata: "ORD",
|
|
coordinates: [-87.9073, 41.9742],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "fra",
|
|
name: "Frankfurt",
|
|
country: "DE",
|
|
iata: "FRA",
|
|
coordinates: [8.5622, 50.0379],
|
|
radius: 1.5,
|
|
},
|
|
{
|
|
id: "bom",
|
|
name: "Mumbai",
|
|
country: "IN",
|
|
iata: "BOM",
|
|
coordinates: [72.8679, 19.0896],
|
|
radius: 1.5,
|
|
},
|
|
];
|