diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index d0c3053..41546eb 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -448,13 +448,15 @@ function DashboardInner({ shop }: { shop: BarberShop }) {
- - + +
-

Reservas online

-

{allShopAppointments.length}

-

Marcações feitas pela plataforma

+

Faturação (Serviços + Produtos)

+

+ {currency(totalRevenue + allShopAppointments.filter(a => a.status === 'concluido' || a.status === 'confirmado').reduce((s, a) => s + (a.total || 0), 0))} +

+

Receita no período selecionado

@@ -525,6 +527,35 @@ function DashboardInner({ shop }: { shop: BarberShop }) { + {/* Serviços Mais Procurados */} + +

Top Serviços

+ {(() => { + const map = new Map(); + allShopAppointments.forEach(a => { + if (a.status === 'cancelado') return; + const svc = shop.services.find(s => s.id === a.serviceId); + if (!svc) return; + const prev = map.get(a.serviceId)?.qty ?? 0; + map.set(a.serviceId, { name: svc.name, qty: prev + 1 }); + }); + const top = Array.from(map.values()).sort((a, b) => b.qty - a.qty).slice(0, 4); + + if (top.length === 0) return

Sem dados suficientes

; + + return ( +
+ {top.map((t, i) => ( +
+ {t.name} + {t.qty} reservas +
+ ))} +
+ ); + })()} +
+ {/* Próximos Agendamentos */}

Seguinte