forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationSettings.js
More file actions
33 lines (30 loc) · 1.14 KB
/
Copy pathNotificationSettings.js
File metadata and controls
33 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use client';
import SettingsToggle from './SettingsToggle';
const NOTIFICATION_OPTIONS = [
{ key: 'email', label: 'Email Notifications', desc: 'Receive updates and alerts via email' },
{ key: 'push', label: 'Push Notifications', desc: 'Browser push notifications for real-time alerts' },
{ key: 'sms', label: 'SMS Notifications', desc: 'Text message alerts for important events' },
];
/**
* Notification preferences: email, push, SMS toggles.
*/
export default function NotificationSettings({ prefs, onChange }) {
return (
<div>
<h3 className="settings-section-title">Notifications</h3>
{NOTIFICATION_OPTIONS.map(({ key, label, desc }) => (
<div key={key} className="settings-row">
<div className="settings-row-info">
<span className="settings-row-label">{label}</span>
<span className="settings-row-desc">{desc}</span>
</div>
<SettingsToggle
id={`notif-${key}`}
checked={prefs.notifications[key]}
onChange={(val) => onChange('notifications', { ...prefs.notifications, [key]: val })}
/>
</div>
))}
</div>
);
}