From 4b48ed359cb92ca6d274d5b963e64510ae74eae9 Mon Sep 17 00:00:00 2001 From: fcarraUniSa Date: Tue, 17 Feb 2026 00:48:04 +0100 Subject: [PATCH] Update AgentDashboard.tsx --- components/AgentDashboard.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/components/AgentDashboard.tsx b/components/AgentDashboard.tsx index 3e11f03..081d308 100644 --- a/components/AgentDashboard.tsx +++ b/components/AgentDashboard.tsx @@ -321,10 +321,15 @@ export const AgentDashboard: React.FC = ({ showToast("Quota creazione articoli AI raggiunta. Impossibile generare nuovi suggerimenti.", 'error'); return; } + + if (!settings.aiConfig.apiKey) { + showToast("Chiave API mancante. Configura l'AI nelle impostazioni.", 'error'); + return; + } setIsAiAnalyzing(true); setAiSuggestion(null); - const suggestion = await generateNewKBArticle(tickets, articles); + const suggestion = await generateNewKBArticle(settings.aiConfig.apiKey, tickets, articles); setAiSuggestion(suggestion); setIsAiAnalyzing(false); }; @@ -828,6 +833,19 @@ export const AgentDashboard: React.FC = ({ /> + + {/* API KEY FIELD */} +
+ + setTempSettings({...tempSettings, aiConfig: {...tempSettings.aiConfig, apiKey: e.target.value}})} + /> +

La chiave non verrĂ  mostrata in chiaro dopo il salvataggio.

+
)}