import { Component, createSignal } from 'solid-js'; import { showSuccess } from '@/utils/toast'; import { SettingsAPI } from '@/api/settings'; import type { WizardState } from '../SetupWizard'; interface FeaturesStepProps { state: WizardState; updateState: (updates: Partial) => void; onNext: () => void; onBack: () => void; } export const FeaturesStep: Component = (props) => { const [aiEnabled, setAiEnabled] = createSignal(false); const [autoUpdates, setAutoUpdates] = createSignal(true); const [isSaving, setIsSaving] = createSignal(false); const features = [ { id: 'ai', name: 'Pulse AI', icon: '🤖', desc: 'Intelligent monitoring assistant with auto-fix capabilities', enabled: aiEnabled, setEnabled: setAiEnabled, badge: 'New in 5.0', }, { id: 'updates', name: 'Automatic Updates', icon: '🔄', desc: 'Keep Pulse up-to-date automatically', enabled: autoUpdates, setEnabled: setAutoUpdates, badge: null, }, ]; const handleContinue = async () => { setIsSaving(true); try { // Only save auto-update setting through SystemConfig // AI settings are configured separately via Settings → AI await SettingsAPI.updateSystemSettings({ autoUpdateEnabled: autoUpdates(), }); props.updateState({ aiEnabled: aiEnabled(), autoUpdatesEnabled: autoUpdates(), }); showSuccess('Preferences saved!'); props.onNext(); } catch (_error) { // Continue anyway - settings can be changed later props.onNext(); } finally { setIsSaving(false); } }; return (

Enable Features

Customize your Pulse experience

{features.map((feature) => ( ))} {/* AI info box */}

Pulse AI Features

• Chat assistant for infrastructure questions
• Patrol mode for proactive monitoring
• Auto-fix for common issues
• Predictive failure detection

Requires API key configuration in Settings → AI after setup

{/* Actions */}
); };