import React, { useState, useEffect } from 'react'; import * as API from '../api.js'; export default function DispatchMapView({ onBack }) { const [data, setData] = useState(null); const [loading, setLoading] = useState(true); const [dispatchMode, setDispatchMode] = useState('batched'); // 'batched' or 'unbatched' useEffect(() => { API.analyzeDispatch().then((res) => { if (res) setData(res); setLoading(false); }); }, []); return (
Standard logistics dispatches riders 1-to-1 per order, creating severe traffic congestion and high delivery costs. HyperFlow clusters nearby spatial-temporal delivery destinations within strict SLA bounds.
{data?.total_deliveries || 5} orders
{dispatchMode === 'batched' ? `${data?.optimized_batches_count || 2} routes` : `${data?.total_deliveries || 5} riders`}
{dispatchMode === 'batched' ? `~${data?.estimated_time_saved_min || 14} min` : '0 min (baseline)'}
HUB ORIGIN: Patia Warehouse [20.3533, 85.8333]