refactor: replace revenue and geofence pages with new hub management system

This commit is contained in:
sazzadulalambd
2026-04-26 16:02:53 +06:00
parent f724a00453
commit 03062bfc48
8 changed files with 884 additions and 291 deletions

View File

@@ -15,7 +15,9 @@ interface Bike {
plateNumber: string;
status: 'available' | 'rented' | 'maintenance' | 'retired';
batteryLevel: number;
location: string;
location?: string; // deprecated - use hubId/hubName
hubId?: string;
hubName?: string;
assignedTo?: string;
investorId?: string;
purchaseDate?: string;
@@ -60,9 +62,10 @@ export default function FleetMapPage() {
const [searchQuery, setSearchQuery] = useState('');
const [selectedBike, setSelectedBike] = useState<Bike | null>(null);
// Generate unique coords for each bike based on its location string
// Generate unique coords for each bike based on its hubName or location
const bikesWithCoords = mockBikes.map((bike, index) => {
const base = locations[bike.location] || { lat: 23.79, lng: 90.40 };
const loc = bike.hubName || bike.location || 'Unknown';
const base = locations[loc] || { lat: 23.79, lng: 90.40 };
// Add jitter
return {
...bike,