feat(collection-map): 'X of Y collected' line in supplier popup

This commit is contained in:
SJCoetz 2026-07-12 12:26:23 +02:00
parent 9769dbb5ae
commit fdd95add30

View file

@ -62,7 +62,7 @@ import {
pinMarker,
unassignedPoolPin,
} from "@/components/leaflet-markers";
import { splitSupplierBucket } from "./pin-model";
import { splitSupplierBucket, aggregateDriverStatus } from "./pin-model";
import {
DriverCardSection,
LegendCard,
@ -868,9 +868,15 @@ function StopPopupBody({
map.closePopup();
onAssign(row);
};
const popupStatus = aggregateDriverStatus(stop.items);
return (
<div className="space-y-2 text-sm min-w-[240px]">
<p className="font-semibold">{stop.supplierName}</p>
{popupStatus.collected > 0 && (
<p className="text-xs font-medium text-emerald-700">
{popupStatus.collected} of {popupStatus.total} collected
</p>
)}
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<Badge variant="outline" className="text-[10px]">
{stop.items.length} stop{stop.items.length === 1 ? "" : "s"}