// Notification Settings Panel for Spaxel Dashboard // Provides UI for configuring push notification channels, quiet hours, and batching export class NotificationSettings { constructor(api) { this.api = api; this.container = null; this.channels = []; this.quietHours = null; this.batching = null; } async init() { this.container = document.getElementById('settings-content'); if (!this.container) { console.error('Settings content container not found'); return; } await this.loadConfig(); this.render(); this.attachListeners(); } async loadConfig() { try { const [channelsRes, quietRes, batchRes] = await Promise.all([ fetch('/api/notifications/channels'), fetch('/api/notifications/quiet-hours'), fetch('/api/notifications/batching') ]); if (channelsRes.ok) { const data = await channelsRes.json(); this.channels = data.channels || []; } if (quietRes.ok) { this.quietHours = await quietRes.json(); } if (batchRes.ok) { this.batching = await batchRes.json(); } } catch (error) { console.error('Failed to load notification config:', error); } } render() { this.container.innerHTML = `
Configure where to send push notifications. Multiple channels can be enabled simultaneously.
Configure times when low-priority notifications are silenced.
Combine multiple events into a single notification to reduce noise.
Choose which types of events trigger notifications.
Send a test notification to verify your configuration.
No notification channels configured.
'; } return this.channels.map(channel => `