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;