add customer name, service info, second pickup location, and structured address fields to deliveries

This commit is contained in:
Egor Pozharov
2026-04-16 20:16:21 +06:00
parent 7f775abf6a
commit ce6ea377ce
16 changed files with 852 additions and 77 deletions
@@ -4,6 +4,8 @@ import type { Delivery } from '../../types';
import { pickupLocationLabels } from '../../types';
import { StatusBadge } from './StatusBadge';
const CITY = 'kokshetau';
interface DeliveryRowProps {
delivery: Delivery;
onStatusChange: (id: string) => void;
@@ -15,7 +17,7 @@ export const DeliveryRow = memo(({ delivery, onStatusChange, onEdit, onDelete }:
const handleAddressClick = (e: React.MouseEvent) => {
e.stopPropagation();
const encodedAddress = encodeURIComponent(delivery.address);
window.open(`https://maps.google.com/?q=${encodedAddress}`, '_blank');
window.open(`https://2gis.kz/${CITY}/search/${encodedAddress}`, '_blank');
};
const handlePhoneClick = (e: React.MouseEvent) => {
@@ -33,15 +35,25 @@ export const DeliveryRow = memo(({ delivery, onStatusChange, onEdit, onDelete }:
/>
</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">{delivery.date}</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">{pickupLocationLabels[delivery.pickupLocation]}</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">{delivery.productName}</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">
{delivery.pickupLocation2
? `${pickupLocationLabels[delivery.pickupLocation]} + ${pickupLocationLabels[delivery.pickupLocation2]}`
: pickupLocationLabels[delivery.pickupLocation]}
</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">
{delivery.productName}
{delivery.productName2 && <span className="block text-xs text-[#75777d]">+ {delivery.productName2}</span>}
</td>
<td className="px-4 py-3 text-sm text-[#1b1b1d]">{delivery.customerName}</td>
<td className="px-4 py-3">
<button
onClick={handleAddressClick}
className="flex items-center gap-1.5 text-sm text-[#1B263B] hover:text-[#F28C28] transition-colors text-left"
>
<MapPin size={14} />
<span className="max-w-[200px] truncate">{delivery.address}</span>
<span className="max-w-[200px] truncate">
ул. {delivery.street}, д. {delivery.house}{delivery.apartment ? `, кв. ${delivery.apartment}` : ''}
</span>
</button>
</td>
<td className="px-4 py-3">