Loading map...
{error}
No collections to show
All collections completed!
'use client'; import { useState, useEffect, useCallback, Suspense, Component } from 'react'; import { useRouter } from 'next/navigation'; import dynamic from 'next/dynamic'; import { OrderItem } from '@/lib/types'; import { useAuth } from '@/components/AuthProvider'; import BottomNav from '@/components/BottomNav'; import { getMyAssignedItems, getMyAssignedStockItems, getPoolItems, getProblemItems, isAuthenticated } from '@/lib/pocketbase'; import { getCached, setCached } from '@/lib/itemsCache'; import { cn } from '@/lib/utils'; import { RefreshCw, MapPin, AlertCircle, Package, Inbox, AlertTriangle } from 'lucide-react'; // Sync the map's dataset with the list page's selected tab via // localStorage so a driver who flips to "Pool" on the list and then // taps Map sees the same pool stops, not just their assigned list. const MAP_TAB_KEY = '1driver_map_tab'; type MapTab = 'assigned' | 'collection_pool' | 'problem'; const CollectionMap = dynamic(() => import('@/components/CollectionMap'), { ssr: false, loading: () => (
Loading map...
Map failed to load.
Loading...
{items.length} stop{items.length !== 1 ? 's' : ''} on map
Loading map...
{error}
No collections to show
All collections completed!