From 63ce62ee247224b4fafc9b6adccc1bdc60be8aea Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Sat, 18 Oct 2025 07:39:02 +0000 Subject: [PATCH] Add a summary of guard availability to the planning view Update the `GeneralPlanningResponse` interface to include a `summary` object containing `totalGuardsNeeded`, `totalGuardsAssigned`, and `totalGuardsMissing`. Render this summary in the UI. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/uZXH8P1 --- client/src/pages/general-planning.tsx | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/src/pages/general-planning.tsx b/client/src/pages/general-planning.tsx index 5167aca..425650c 100644 --- a/client/src/pages/general-planning.tsx +++ b/client/src/pages/general-planning.tsx @@ -56,6 +56,11 @@ interface GeneralPlanningResponse { weekEnd: string; location: string; days: DayData[]; + summary: { + totalGuardsNeeded: number; + totalGuardsAssigned: number; + totalGuardsMissing: number; + }; } export default function GeneralPlanning() { @@ -184,6 +189,36 @@ export default function GeneralPlanning() { + {/* Summary Guardie Settimana */} + {!isLoading && planningData?.summary && ( + + + + + Riepilogo Guardie Settimana + + + +
+
+

Guardie Necessarie

+

{planningData.summary.totalGuardsNeeded}

+
+
+

Guardie Pianificate

+

{planningData.summary.totalGuardsAssigned}

+
+
0 ? 'bg-destructive/10 border-destructive/20' : 'bg-green-500/10 border-green-500/20'}`}> +

Guardie Mancanti

+

0 ? 'text-destructive' : 'text-green-600 dark:text-green-500'}`}> + {planningData.summary.totalGuardsMissing} +

+
+
+
+
+ )} + {/* Tabella Planning */}