diff --git a/manager/components/Exams.tsx b/manager/components/Exams.tsx index 62c3439..daaf9b9 100644 --- a/manager/components/Exams.tsx +++ b/manager/components/Exams.tsx @@ -20,6 +20,13 @@ const Exams: React.FC = ({ data, updateData }) => { const [activeTab, setActiveTab] = useState<'ativos' | 'lixeira'>('ativos'); const { showAlert, showConfirm } = useDialog(); + const activeProvider = data.aiConfig?.activeProvider || 'gemini'; + const hasActiveKey = + (activeProvider === 'gemini' && !!data.aiConfig?.geminiKey) || + (activeProvider === 'openai' && !!data.aiConfig?.openaiKey) || + (activeProvider === 'claude' && !!data.aiConfig?.claudeKey) || + (activeProvider === 'openrouter' && !!data.aiConfig?.openrouterKey); + const [showAIConfigModal, setShowAIConfigModal] = useState(false); const [aiForm, setAiForm] = useState({ activeProvider: data.aiConfig?.activeProvider || 'gemini', @@ -972,7 +979,7 @@ const Exams: React.FC = ({ data, updateData }) => { Questão
- {aiConfig.apiKey && ( + {hasActiveKey && (