'use client' import { useState } from 'react' import { useTranslations, useLocale } from 'next-intl' import { useAuth } from '@/hooks/use-auth' import { ProtectedRoute } from '@/components/auth/protected-route' import { Container, Paper, Box, Typography, Switch, FormControlLabel, Select, MenuItem, FormControl, InputLabel, Grid, Card, CardContent, Divider, Alert, Button } from '@mui/material' import { Settings as SettingsIcon, Palette, TextFields, Language, Notifications, Security, Save } from '@mui/icons-material' export default function SettingsPage() { const { user } = useAuth() const locale = useLocale() const t = useTranslations('settings') const [settings, setSettings] = useState({ theme: user?.theme || 'light', fontSize: user?.fontSize || 'medium', notifications: true, emailUpdates: false, language: locale }) const [message, setMessage] = useState('') const handleSettingChange = (setting: string, value: any) => { setSettings(prev => ({ ...prev, [setting]: value })) } const handleSave = async () => { try { // TODO: Implement settings update API await new Promise(resolve => setTimeout(resolve, 1000)) // Placeholder setMessage(t('settingsSaved')) } catch (error) { setMessage(t('settingsError')) } } return ( {/* Header */} {t('title')} {t('subtitle')} {/* Appearance Settings */} {t('appearance')} {t('theme')} {t('fontSize')} {/* Language & Notifications */} {t('languageAndNotifications')} {t('language')} handleSettingChange('notifications', e.target.checked)} /> } label={t('notifications')} /> handleSettingChange('emailUpdates', e.target.checked)} /> } label={t('emailUpdates')} /> {/* Security Settings */} {t('security')} {t('passwordSecurity')} {/* Save Button */} {/* Success/Error Message */} {message && ( setMessage('')} > {message} )} ) }