add whatsapp contact button and prepayment/full payment badge
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-06-17 13:57:54 +05:00
parent d1efebbb34
commit 906563c7c3
17 changed files with 191 additions and 41 deletions
@@ -3,6 +3,9 @@ import { MapPin, Phone } from 'lucide-react';
import type { Delivery } from '../../types';
import { formatPickupLocation } from '../../types';
import { StatusBadge } from './StatusBadge';
import { PaymentBadge } from './PaymentBadge';
import { WhatsAppIcon } from '../ui/WhatsAppIcon';
import { getWhatsAppUrl } from '../../utils/phone';
const CITY = 'kokshetau';
@@ -25,6 +28,11 @@ export const DeliveryRow = memo(({ delivery, onStatusChange, onEdit, onDelete }:
window.location.href = `tel:${delivery.phone}`;
};
const handleWhatsAppClick = (e: React.MouseEvent) => {
e.stopPropagation();
window.location.href = getWhatsAppUrl(delivery.phone);
};
return (
<tr className="hover:bg-[#f5f3f5] transition-colors border-b border-[#e4e2e4] last:border-b-0">
<td className="px-4 py-3">
@@ -57,13 +65,26 @@ export const DeliveryRow = memo(({ delivery, onStatusChange, onEdit, onDelete }:
</button>
</td>
<td className="px-4 py-3">
<button
onClick={handlePhoneClick}
className="flex items-center gap-1.5 text-sm text-[#16a34a] hover:underline transition-colors"
>
<Phone size={14} />
{delivery.phone}
</button>
<div className="flex items-center gap-2">
<button
onClick={handlePhoneClick}
className="flex items-center gap-1.5 text-sm text-[#16a34a] hover:underline transition-colors"
>
<Phone size={14} />
{delivery.phone}
</button>
<button
onClick={handleWhatsAppClick}
className="p-1.5 rounded-md text-[#16a34a] hover:bg-[#f5f3f5] transition-colors"
title="Открыть WhatsApp"
aria-label={`Открыть WhatsApp для номера ${delivery.phone}`}
>
<WhatsAppIcon className="h-5 w-5" />
</button>
</div>
</td>
<td className="px-4 py-3 text-sm text-[#45474d] max-w-[200px] truncate">
<PaymentBadge status={delivery.paymentStatus} size="sm" />
</td>
<td className="px-4 py-3 text-sm text-[#45474d] max-w-[200px] truncate">
{delivery.comment || '-'}