feat: Hide AI buttons when AI is not configured. Closes #905

- InvestigateProblemsButton now checks aiChatStore.enabled
- InvestigateAlertButton returns null when AI is not enabled
- This provides cleaner UX for users who don't use AI features
This commit is contained in:
rcourtman
2025-12-25 11:50:06 +00:00
parent e1b3af7ca0
commit 39e5d42305
2 changed files with 8 additions and 2 deletions
@@ -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();
@@ -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 (