feat: add live rental tracking map view with GPS coordinates and real-time refresh
This commit is contained in:
@@ -4,7 +4,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import {
|
import {
|
||||||
FileText, Search, Filter, Bike, User, Calendar, DollarSign, Clock, MoreVertical,
|
FileText, Search, Filter, Bike, User, Calendar, DollarSign, Clock, MoreVertical,
|
||||||
Eye, Plus, Phone, MessageCircle, X, CreditCard, Wallet, Building, Download,
|
Eye, Plus, Phone, MessageCircle, X, CreditCard, Wallet, Building, Download,
|
||||||
Printer, ChevronLeft, ChevronRight, CheckCircle, AlertTriangle
|
Printer, ChevronLeft, ChevronRight, CheckCircle, AlertTriangle, MapPin
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import {
|
import {
|
||||||
@@ -60,6 +60,11 @@ interface Rental {
|
|||||||
lockedReason?: string;
|
lockedReason?: string;
|
||||||
hubId: string;
|
hubId: string;
|
||||||
hubName: string;
|
hubName: string;
|
||||||
|
location?: {
|
||||||
|
lat: number;
|
||||||
|
lng: number;
|
||||||
|
address?: string;
|
||||||
|
};
|
||||||
initialImages?: BikeImage[];
|
initialImages?: BikeImage[];
|
||||||
imagesApproved: boolean;
|
imagesApproved: boolean;
|
||||||
bikerNote?: string;
|
bikerNote?: string;
|
||||||
@@ -182,6 +187,7 @@ const mockRentals: Rental[] = [
|
|||||||
penaltyAmount: 0,
|
penaltyAmount: 0,
|
||||||
hubId: 'HUB-001',
|
hubId: 'HUB-001',
|
||||||
hubName: 'Gulshan Hub',
|
hubName: 'Gulshan Hub',
|
||||||
|
location: { lat: 23.7925, lng: 90.4074, address: 'Gulshan 1, Dhaka' },
|
||||||
imagesApproved: true,
|
imagesApproved: true,
|
||||||
createdAt: '2024-01-15',
|
createdAt: '2024-01-15',
|
||||||
acceptedAt: '2024-01-15',
|
acceptedAt: '2024-01-15',
|
||||||
@@ -216,6 +222,7 @@ const mockRentals: Rental[] = [
|
|||||||
penaltyAmount: 0,
|
penaltyAmount: 0,
|
||||||
hubId: 'HUB-002',
|
hubId: 'HUB-002',
|
||||||
hubName: 'Banani Hub',
|
hubName: 'Banani Hub',
|
||||||
|
location: { lat: 23.8041, lng: 90.4152, address: 'Banani, Dhaka' },
|
||||||
imagesApproved: false,
|
imagesApproved: false,
|
||||||
createdAt: '2024-02-10',
|
createdAt: '2024-02-10',
|
||||||
},
|
},
|
||||||
@@ -568,6 +575,12 @@ export default function RentalsPage() {
|
|||||||
<button className="py-2 px-4 border border-slate-200 rounded-lg text-sm font-medium text-slate-600 hover:bg-slate-50 flex items-center justify-center gap-2">
|
<button className="py-2 px-4 border border-slate-200 rounded-lg text-sm font-medium text-slate-600 hover:bg-slate-50 flex items-center justify-center gap-2">
|
||||||
<Download className="w-4 h-4" /> Export
|
<Download className="w-4 h-4" /> Export
|
||||||
</button>
|
</button>
|
||||||
|
<Link
|
||||||
|
href="/admin/rentals/map"
|
||||||
|
className="py-2 px-4 border border-slate-200 rounded-lg text-sm font-medium text-slate-600 hover:bg-slate-50 flex items-center justify-center gap-2"
|
||||||
|
>
|
||||||
|
<MapPin className="w-4 h-4" /> Map View
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user