'use client' import Link from 'next/link' import { useEffect } from 'react' import { useAuthStore } from '@/store/authStore' import { useRouter } from 'next/navigation' export default function SettingsPage() { const router = useRouter() const { isAuthenticated, logout } = useAuthStore() useEffect(() => { if (!isAuthenticated) router.replace('/login') }, [isAuthenticated, router]) if (!isAuthenticated) return null const handleLogout = async () => { await logout() router.push('/') } const sections = [ { title: 'Account', href: '/settings/account', icon: '👤', desc: 'Name, email, username, password' }, { title: 'Privacy', href: '/settings/privacy', icon: '🔒', desc: 'Visibility, DMs, data export, 2FA' }, { title: 'Notifications', href: '/settings/notifications', icon: '🔔', desc: 'Push, email, quiet hours' }, { title: 'Appearance', href: '/settings/appearance', icon: '🎨', desc: 'Theme, font size, language, density' }, { title: 'Security', href: '/settings/security', icon: '🛡️', desc: 'Sessions, login history, 2FA' }, { title: 'Blocked Users', href: '/settings/blocked', icon: '🚫', desc: 'Manage blocked accounts' }, { title: 'Moderation', href: '/settings/moderation', icon: '🔇', desc: 'Muted words, accounts, and threads' }, { title: 'Language', href: '/settings/language', icon: '🌐', desc: 'Display language and region' }, { title: 'Data & Storage', href: '/settings/data', icon: '💾', desc: 'Cache, downloads, data export' }, { title: 'Subscription', href: '/settings/subscription', icon: '⭐', desc: 'Plan, billing, premium features' }, { title: 'Preferences', href: '/settings/preferences', icon: '⚙️', desc: 'Accessibility, autoplay, content' }, ] return (