+ {isLoading && (
+
+
+
Calcul de l'itineraire...
+
+ )}
+
+ {/* Panneau d'instruction principale */}
+ {isNavigating && currentInstruction && (
+
+
+
+
+
+
+
+ {currentInstruction.instruction}
+
+ {currentInstruction.streetName && (
+
+ {currentInstruction.streetName}
+
+ )}
+
+
+ {currentInstruction.distance}
+
+
+
+ {nextInstruction && (
+
+ Puis
+
+
+
+
+ {nextInstruction.instruction}
+
+
+ )}
+
+ )}
+
+
+
+ {/* Bouton recentrer */}
+ {driverLocation && (
+
+ )}
+
+ {/* Infos de route */}
+ {routeInfo && (
+
+
+ Distance
+
+ {routeInfo.distance}
+
+
+
+
+ Duree
+
+ {routeInfo.duration}
+
+
+ {instructions.length > 0 && (
+ <>
+
+
+ >
+ )}
+
+ )}
+
+ {/* Liste des instructions */}
+ {showAllInstructions && instructions.length > 0 && (
+
+
+
Etapes de l'itineraire
+
+
+
+ {instructions.map((inst, index) => (
+
+
+
+
+
+
+ {inst.instruction}
+
+ {inst.streetName && (
+
+ {inst.streetName}
+
+ )}
+
+
+ {inst.distance}
+
+
+ ))}
+
+
+ )}
+
+ {error &&
{error}
}
+
+ );
+}
+
+export default TomTomMap;
diff --git a/frontend-prep/src/pages/Livreur/DeliveryDashboard.tsx b/frontend-prep/src/pages/Livreur/DeliveryDashboard.tsx
index 06178fac..b7a3c551 100644
--- a/frontend-prep/src/pages/Livreur/DeliveryDashboard.tsx
+++ b/frontend-prep/src/pages/Livreur/DeliveryDashboard.tsx
@@ -32,6 +32,7 @@ import {
endAlert,
getMyAlerts,
} from "../../api/api_delivery";
+import TomTomMap from "../../components/TomTomMap";
interface DeliveryStats {
todayDeliveries: number;
@@ -117,6 +118,9 @@ function DeliveryDashboard() {
const [isAlertTriggered, setIsAlertTriggered] = useState(false);
const [policeAlertLoading, setPoliceAlertLoading] = useState(false);
+ const [showMap, setShowMap] = useState(false);
+ const [routeDistance, setRouteDistance] = useState