import { useState } from 'react'; import { Search, MapPin } from 'lucide-react'; interface Location { id: string; name: string; address: string; city: string; state: string; zip: string; hours: string; phone: string; amenities: string[]; coordinates: { lat: number; lng: number; }; } const locations: Location[] = [ { id: 'sf-downtown', name: 'San Francisco Downtown', address: '123 Market Street', city: 'San Francisco', state: 'CA', zip: '94105', hours: 'Mon-Sun: 7am-10pm', phone: '(415) 555-1234', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Accessories Shop', 'Restrooms'], coordinates: { lat: 37.7749, lng: -122.4194, }, }, { id: 'la-century', name: 'Los Angeles Century City', address: '1888 Century Park East', city: 'Los Angeles', state: 'CA', zip: '90067', hours: 'Mon-Sun: 8am-9pm', phone: '(310) 555-6789', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Car Wash', 'Restrooms'], coordinates: { lat: 34.0522, lng: -118.2437, }, }, { id: 'nyc-manhattan', name: 'New York - Manhattan', address: '347 West 34th Street', city: 'New York', state: 'NY', zip: '10001', hours: 'Mon-Sun: 9am-8pm', phone: '(212) 555-8901', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Accessories Shop', 'Coffee Bar'], coordinates: { lat: 40.7128, lng: -74.006, }, }, { id: 'miami-beach', name: 'Miami Beach', address: '1100 Collins Avenue', city: 'Miami Beach', state: 'FL', zip: '33139', hours: 'Mon-Sun: 8am-10pm', phone: '(305) 555-2345', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Car Wash', 'Coffee Bar', 'Restrooms'], coordinates: { lat: 25.7617, lng: -80.1918, }, }, { id: 'chicago-loop', name: 'Chicago - The Loop', address: '333 South Wabash Avenue', city: 'Chicago', state: 'IL', zip: '60604', hours: 'Mon-Sun: 7am-9pm', phone: '(312) 555-3456', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Restrooms'], coordinates: { lat: 41.8781, lng: -87.6298, }, }, { id: 'seattle-downtown', name: 'Seattle Downtown', address: '500 Pine Street', city: 'Seattle', state: 'WA', zip: '98101', hours: 'Mon-Sun: 7am-8pm', phone: '(206) 555-4567', amenities: ['Tesla Superchargers', 'Waiting Lounge', 'Accessories Shop', 'Restrooms'], coordinates: { lat: 47.6062, lng: -122.3321, }, }, ]; const cities = ['All Cities', 'San Francisco', 'Los Angeles', 'New York', 'Miami Beach', 'Chicago', 'Seattle']; const LocationsPage = () => { const [searchQuery, setSearchQuery] = useState(''); const [selectedCity, setSelectedCity] = useState('All Cities'); const [selectedLocation, setSelectedLocation] = useState(null); const filteredLocations = locations.filter((location) => { const matchesSearch = searchQuery === '' || location.name.toLowerCase().includes(searchQuery.toLowerCase()) || location.address.toLowerCase().includes(searchQuery.toLowerCase()) || location.city.toLowerCase().includes(searchQuery.toLowerCase()) || location.state.toLowerCase().includes(searchQuery.toLowerCase()) || location.zip.toLowerCase().includes(searchQuery.toLowerCase()); const matchesCity = selectedCity === 'All Cities' || location.city === selectedCity; return matchesSearch && matchesCity; }); const handleLocationClick = (location: Location) => { setSelectedLocation(location); }; return (
{/* Header */}

Our Locations

Find the nearest pickup and dropoff location for your electric vehicle rental.

{/* Search and Filter */}
setSearchQuery(e.target.value)} />
{/* Main Content */}
{/* Locations List */}

{filteredLocations.length} {filteredLocations.length === 1 ? 'Location' : 'Locations'} Found

{filteredLocations.length > 0 ? ( filteredLocations.map((location) => ( )) ) : (

No locations found matching your search criteria.

)}
{/* Map and Location Details */}
{selectedLocation ? (
{/* Map Placeholder */}

Interactive map would be displayed here with location:

{selectedLocation.name}

Coordinates: {selectedLocation.coordinates.lat}, {selectedLocation.coordinates.lng}

{/* Location Details */}

{selectedLocation.name}

{selectedLocation.address}, {selectedLocation.city}, {selectedLocation.state} {selectedLocation.zip}

Hours & Contact

Hours

{selectedLocation.hours}

Phone

{selectedLocation.phone}

Amenities

    {selectedLocation.amenities.map((amenity, index) => (
  • {amenity}
  • ))}
) : (

Select a Location

Choose a location from the list to view details and availability information.

)}
); }; export default LocationsPage;