Sửa hiển thị tên/email của người thanh toán

This commit is contained in:
2026-06-14 16:05:14 +07:00
parent 71007bd9a1
commit 3a29f98c96
8 changed files with 36 additions and 14 deletions
+12 -7
View File
@@ -250,13 +250,18 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin
</div>
<div>
<label className="block text-xs font-bold text-gray-600 mb-1">Thành viên đã thanh toán</label>
<select className="w-full px-3 py-2 bg-white border border-gray-200 rounded-xl outline-none text-sm"
value={formData.paidById} onChange={e => setFormData({...formData, paidById: e.target.value})}>
<option value="">-- Chọn người thanh toán --</option>
{currentTour?.participants?.map((p: any) => (
<option key={p.userId} value={p.userId}>{p.user?.name || p.userId}</option>
))}
</select>
<select className="w-full px-3 py-2 bg-white border border-gray-200 rounded-xl outline-none text-sm"
value={formData.paidById} onChange={e => setFormData({...formData, paidById: e.target.value})}>
<option value="">-- Chọn người thanh toán --</option>
{currentTour?.participants?.map((p: any) => {
const name = p.user?.name;
const email = p.user?.email;
const label = [name, email && name ? `(${email})` : email].filter(Boolean).join(' ');
return (
<option key={p.userId} value={p.userId}>{label || p.userId}</option>
);
})}
</select>
</div>
</div>
<div>