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 { 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>
{/* 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 && delivery.productName2 && (
<div className="flex items-start gap-2 text-sm pl-6">
<span className="text-[#75777d] text-xs">Со 2-й точки: {delivery.productName2}</span>
{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 className="flex items-center gap-2 text-sm">
<Package size={16} className="text-[#75777d]" />
<span className="text-[#1b1b1d]">{delivery.productName}</span>
</div>
</div>
<button