import { useState } from "react"; import { cn } from "~/lib/utils"; import { Bell, BellOff, Volume2, VolumeX, Clock, Filter, ChevronRight } from "lucide-react"; import { Button } from "@/routes/ui/button"; export interface NotificationSettings { enabled: boolean; sound: boolean; quietHoursEnabled: boolean; quietHoursStart: string; quietHoursEnd: string; groupNotifications: boolean; priorities: { high: boolean; medium: boolean; low: boolean; }; categories: { priceAlerts: boolean; whaleActivity: boolean; rugPullWarnings: boolean; portfolioUpdates: boolean; newsAlerts: boolean; }; } export interface NotificationSettingsPanelProps { settings: NotificationSettings; onSettingsChange: (settings: NotificationSettings) => void; className?: string; } const DEFAULT_SETTINGS: NotificationSettings = { enabled: true, sound: true, quietHoursEnabled: false, quietHoursStart: "22:00", quietHoursEnd: "08:00", groupNotifications: true, priorities: { high: true, medium: true, low: false, }, categories: { priceAlerts: true, whaleActivity: true, rugPullWarnings: true, portfolioUpdates: true, newsAlerts: false, }, }; /** * NotificationSettingsPanel - Configure notification preferences * Part of Epic 4.4 - Smart Notifications */ export function NotificationSettingsPanel({ settings = DEFAULT_SETTINGS, onSettingsChange, className, }: NotificationSettingsPanelProps) { const updateSettings = (partial: Partial) => { onSettingsChange({ ...settings, ...partial }); }; const updatePriority = (key: keyof NotificationSettings["priorities"], value: boolean) => { onSettingsChange({ ...settings, priorities: { ...settings.priorities, [key]: value }, }); }; const updateCategory = (key: keyof NotificationSettings["categories"], value: boolean) => { onSettingsChange({ ...settings, categories: { ...settings.categories, [key]: value }, }); }; return (
{/* Header */}
Notification Settings
{settings.enabled && ( <> {/* Sound Toggle */}
{settings.sound ? ( ) : ( )} Sound
{/* Quiet Hours */}
Quiet Hours
{settings.quietHoursEnabled && (
updateSettings({ quietHoursStart: e.target.value })} className="bg-muted rounded px-2 py-1" /> to updateSettings({ quietHoursEnd: e.target.value })} className="bg-muted rounded px-2 py-1" />
)}
{/* Priority Levels */}
Priority Levels
{(["high", "medium", "low"] as const).map((priority) => ( ))}
{/* Categories */}
Categories
{Object.entries(settings.categories).map(([key, value]) => ( ))}
{/* Group Notifications */}
Group similar notifications
)}
); }