diff --git a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx index 00ad59efb..96de30267 100644 --- a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx +++ b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx @@ -17,11 +17,17 @@ interface InvestigateAlertButtonProps { /** * "Ask AI" button for one-click alert investigation. * When clicked, opens the AI chat panel with the alert context pre-populated. + * Hidden entirely when AI is not configured. */ export function InvestigateAlertButton(props: InvestigateAlertButtonProps) { const [isHovered, setIsHovered] = createSignal(false); const isLocked = () => props.licenseLocked === true; + // Don't render if AI is not enabled + if (aiChatStore.enabled !== true) { + return null; + } + const handleClick = (e: MouseEvent) => { e.stopPropagation(); e.preventDefault(); diff --git a/frontend-modern/src/components/Dashboard/InvestigateProblemsButton.tsx b/frontend-modern/src/components/Dashboard/InvestigateProblemsButton.tsx index c57088c2c..eff09756c 100644 --- a/frontend-modern/src/components/Dashboard/InvestigateProblemsButton.tsx +++ b/frontend-modern/src/components/Dashboard/InvestigateProblemsButton.tsx @@ -118,9 +118,9 @@ Start with the most critical problems first.`; }); }; - // Only show if problems mode is active AND there are results + // Only show if problems mode is active AND there are results AND AI is enabled const shouldShow = createMemo(() => - props.isProblemsMode && props.problemGuests.length > 0 + props.isProblemsMode && props.problemGuests.length > 0 && aiChatStore.enabled === true ); return (