From 98b23fe12eae045283282dd3385bb4cbe5afe17f Mon Sep 17 00:00:00 2001 From: soufiane Date: Fri, 5 Dec 2025 11:49:06 +0100 Subject: [PATCH] feat: add active/inactive clients statistics to admin dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add activeClients and inactiveClients to AdminStatistics type - Add pie chart showing client status (active/inactive) - Add detailed stats rows for active/inactive clients 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/admin/dashboard/page.tsx | 41 ++++++++++++++++++++++++++++++++++++ types/index.ts | 2 ++ 2 files changed, 43 insertions(+) diff --git a/app/admin/dashboard/page.tsx b/app/admin/dashboard/page.tsx index fa4a890..e76ef16 100644 --- a/app/admin/dashboard/page.tsx +++ b/app/admin/dashboard/page.tsx @@ -187,6 +187,12 @@ export default function AdminDashboardAdvanced() { { name: "Admins", value: stats.users.admins || 0, color: "#3b82f6" }, ].filter(item => item.value > 0); + // Données pour le graphique des clients actifs/inactifs + const clientStatusData = [ + { name: "Actifs", value: stats.users.activeClients || 0, color: "#10b981" }, + { name: "Inactifs", value: stats.users.inactiveClients || 0, color: "#ef4444" }, + ].filter(item => item.value > 0); + const ticketDistributedPercent = stats.tickets.total > 0 ? ((stats.tickets.distributed / stats.tickets.total) * 100).toFixed(1) : 0; @@ -389,6 +395,39 @@ export default function AdminDashboardAdvanced() { )} + {/* Graphique Clients Actifs/Inactifs */} + {clientStatusData.length > 0 && ( +
+

+
+ +
+ Statut des Clients +

+ + + `${name}: ${value}`} + outerRadius={80} + innerRadius={40} + fill="#8884d8" + dataKey="value" + > + {clientStatusData.map((entry, index) => ( + + ))} + + + + + +
+ )} + {/* Graphique répartition par genre */} {genderChartData.length > 0 && (
@@ -502,6 +541,8 @@ export default function AdminDashboardAdvanced() {
+ +
diff --git a/types/index.ts b/types/index.ts index 9dc01fb..dbf32e4 100644 --- a/types/index.ts +++ b/types/index.ts @@ -187,6 +187,8 @@ export interface AdminStatistics { users: { total: number; clients: number; + activeClients: number; + inactiveClients: number; employees: number; admins: number; verifiedEmails: number;