feat: show customer name on product orders

This commit is contained in:
2026-06-16 15:43:38 +01:00
parent a78b72b96f
commit e27afc4e76

View File

@@ -984,6 +984,7 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
const prod = shop.products.find((p) => p.id === item.refId);
return sum + (prod?.price ?? 0) * item.qty;
}, 0);
const customer = users.find(u => u.id === o.customerId);
return (
<div key={o.id} className="p-4 border border-slate-200 rounded-lg hover:border-indigo-300 transition-colors">
<div className="flex items-center justify-between mb-3">
@@ -1005,7 +1006,10 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
))}
</select>
</div>
<p className="text-sm text-slate-600 mb-2">{new Date(o.createdAt).toLocaleString('pt-BR')}</p>
<div className="mb-3 border-b border-slate-100 pb-2">
<p className="text-sm font-semibold text-slate-900">Cliente: {customer?.name || 'Cliente'}</p>
<p className="text-xs text-slate-500 mt-0.5">{new Date(o.createdAt).toLocaleString('pt-PT')}</p>
</div>
<div className="space-y-1">
{productItems.map((item) => {
const prod = shop.products.find((p) => p.id === item.refId);