update DeliveryCard to pair pickup locations with product names in a single section
Some checks failed
Build and Push Docker Images / build-backend (push) Has been cancelled
Build and Push Docker Images / build-frontend (push) Has been cancelled

This commit is contained in:
Egor Pozharov
2026-04-16 23:36:55 +06:00
parent 6647379abc
commit 57fd82c6dd

View File

@@ -1,5 +1,5 @@
import { memo } from 'react'; import { memo } from 'react';
import { MapPin, Phone, Package, Store, Calendar, MessageSquare, CheckCircle2, Circle, CheckSquare, User, Wrench } from 'lucide-react'; import { MapPin, Phone, Store, Calendar, MessageSquare, CheckCircle2, Circle, CheckSquare, User, Wrench } from 'lucide-react';
import type { Delivery } from '../../types'; import type { Delivery } from '../../types';
import { pickupLocationLabels } from '../../types'; import { pickupLocationLabels } from '../../types';
import { StatusBadge } from './StatusBadge'; import { StatusBadge } from './StatusBadge';
@@ -58,24 +58,23 @@ export const DeliveryCard = memo(({ delivery, onStatusChange, onEdit, onDelete }
<span className="text-[#1b1b1d] font-medium">{delivery.date}</span> <span className="text-[#1b1b1d] font-medium">{delivery.date}</span>
</div> </div>
{/* Pickup locations */} {/* Pickup locations paired with products */}
<div className="flex items-center gap-2 text-sm"> <div className="flex items-start gap-2 text-sm">
<Store size={16} className="text-[#75777d]" /> <Store size={16} className="text-[#75777d] mt-0.5 shrink-0" />
<span className="text-[#1b1b1d]"> <div className="flex flex-col gap-1 min-w-0">
{delivery.pickupLocation2 <div className="flex items-baseline gap-2 flex-wrap">
? `${pickupLocationLabels[delivery.pickupLocation]} + ${pickupLocationLabels[delivery.pickupLocation2]}` <span className="text-[#1b1b1d] font-medium">{pickupLocationLabels[delivery.pickupLocation]}</span>
: pickupLocationLabels[delivery.pickupLocation]} <span className="text-[#75777d]"></span>
</span> <span className="text-[#1b1b1d]">{delivery.productName}</span>
</div> </div>
{delivery.pickupLocation2 && delivery.productName2 && ( {delivery.pickupLocation2 && (
<div className="flex items-start gap-2 text-sm pl-6"> <div className="flex items-baseline gap-2 flex-wrap">
<span className="text-[#75777d] text-xs">Со 2-й точки: {delivery.productName2}</span> <span className="text-[#1b1b1d] font-medium">{pickupLocationLabels[delivery.pickupLocation2]}</span>
<span className="text-[#75777d]"></span>
<span className="text-[#1b1b1d]">{delivery.productName2 || '—'}</span>
</div>
)}
</div> </div>
)}
<div className="flex items-center gap-2 text-sm">
<Package size={16} className="text-[#75777d]" />
<span className="text-[#1b1b1d]">{delivery.productName}</span>
</div> </div>
<button <button