'use client' import { useAuth } from '@thedaviddias/auth' import { Button } from '@thedaviddias/design-system/button' import { Mail } from 'lucide-react' import { useEffect, useState } from 'react' import { toast } from 'sonner' import { NewsletterModal } from '@/components/newsletter-modal' import { Card } from '@/components/ui/card' import { analytics } from '@/lib/analytics' export default function NotificationsSettingsPage() { const { user } = useAuth() const [showNewsletterModal, setShowNewsletterModal] = useState(false) const [_settings, setSettings] = useState({ emailNewsletter: false, emailUpdates: true, emailSubmissions: true, emailSecurity: true, pushNotifications: false, weeklyDigest: true, communityUpdates: false }) const _hasGitHubAuth = user && (user.user_metadata?.github_username || user.user_metadata?.user_name) useEffect(() => { analytics.settingsPageView('notifications', 'settings') }, []) /** * Updates a notification setting preference */ const _handleSettingChange = (key: string, value: boolean) => { setSettings(prev => ({ ...prev, [key]: value })) analytics.settingsToggleChange(key, value, 'notifications') toast.success('Notification preference updated') } /** * Opens the newsletter subscription modal */ const handleNewsletterSubscribe = () => { analytics.newsletterSignup('settings-notifications') setShowNewsletterModal(true) } return (
Choose what updates you'd like to receive
Updates on new projects, trends, and community highlights
Get curated updates about the latest AI documentation trends, featured projects, and community insights delivered to your inbox via Substack.