update DeliveryCard to pair pickup locations with product names in a single section
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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 { pickupLocationLabels } from '../../types';
|
||||
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>
|
||||
</div>
|
||||
|
||||
{/* Pickup locations */}
|
||||
<div className="flex items-center gap-2 text-sm">
|
||||
<Store size={16} className="text-[#75777d]" />
|
||||
<span className="text-[#1b1b1d]">
|
||||
{delivery.pickupLocation2
|
||||
? `${pickupLocationLabels[delivery.pickupLocation]} + ${pickupLocationLabels[delivery.pickupLocation2]}`
|
||||
: pickupLocationLabels[delivery.pickupLocation]}
|
||||
</span>
|
||||
</div>
|
||||
{delivery.pickupLocation2 && delivery.productName2 && (
|
||||
<div className="flex items-start gap-2 text-sm pl-6">
|
||||
<span className="text-[#75777d] text-xs">Со 2-й точки: {delivery.productName2}</span>
|
||||
{/* Pickup locations paired with products */}
|
||||
<div className="flex items-start gap-2 text-sm">
|
||||
<Store size={16} className="text-[#75777d] mt-0.5 shrink-0" />
|
||||
<div className="flex flex-col gap-1 min-w-0">
|
||||
<div className="flex items-baseline gap-2 flex-wrap">
|
||||
<span className="text-[#1b1b1d] font-medium">{pickupLocationLabels[delivery.pickupLocation]}</span>
|
||||
<span className="text-[#75777d]">—</span>
|
||||
<span className="text-[#1b1b1d]">{delivery.productName}</span>
|
||||
</div>
|
||||
{delivery.pickupLocation2 && (
|
||||
<div className="flex items-baseline gap-2 flex-wrap">
|
||||
<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 className="flex items-center gap-2 text-sm">
|
||||
<Package size={16} className="text-[#75777d]" />
|
||||
<span className="text-[#1b1b1d]">{delivery.productName}</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user