Les comptes déjà créés ne sont pas inscrits. Le choix est facultatif à l’inscription et dans les paramètres. Un lien public demande confirmation avant d’arrêter les actualités, sans toucher aux messages de compte.
31 lines
878 B
TypeScript
31 lines
878 B
TypeScript
import { auth } from '@/auth'
|
|
import { redirect } from 'next/navigation'
|
|
import { getAISettings } from '@/app/actions/ai-settings'
|
|
import { getMyMarketingPreference } from '@/app/actions/marketing-preference'
|
|
import { GeneralSettingsClient } from './general-settings-client'
|
|
|
|
export default async function GeneralSettingsPage() {
|
|
const session = await auth()
|
|
if (!session?.user) {
|
|
redirect('/api/auth/signin')
|
|
}
|
|
|
|
const {
|
|
preferredLanguage,
|
|
emailNotifications,
|
|
desktopNotifications,
|
|
autoSave,
|
|
} = await getAISettings()
|
|
const marketing = await getMyMarketingPreference()
|
|
|
|
return (
|
|
<GeneralSettingsClient
|
|
initialSettings={{ preferredLanguage, emailNotifications, desktopNotifications, autoSave }}
|
|
initialMarketing={{
|
|
optedIn: marketing?.optedIn === true,
|
|
blocked: marketing?.blocked === true,
|
|
}}
|
|
/>
|
|
)
|
|
}
|