mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 19:57:09 +00:00
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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user