import React from 'react'; import { Sun, Moon } from 'lucide-react'; import { usePreferences } from '../contexts/PreferencesContext'; import { useThemeContext } from '../contexts/ThemeContext'; export function SettingsView() { const { preferences, updatePreferences } = usePreferences(); const { theme } = useThemeContext(); const handleThemeChange = async (newTheme: 'light' | 'dark') => { await updatePreferences({ theme: newTheme }); // Theme will be updated automatically through ThemeContext }; const handleSortChange = async (newSort: 'dateCreated' | 'alphabetical') => { await updatePreferences({ habit_sort: newSort }); // Sort will be updated automatically through ThemeContext }; const handleStreaksChange = async (showStreaks: boolean) => { await updatePreferences({ show_streaks: showStreaks }); // Streaks visibility will be updated automatically through ThemeContext }; return (