import { auth } from '@/auth'
import { redirect } from 'next/navigation'
import { getAISettings } from '@/app/actions/ai-settings'
import { GeneralSettingsClient } from './general-settings-client'

export default async function GeneralSettingsPage() {
  const session = await auth()
  if (!session?.user) {
    redirect('/api/auth/signin')
  }

  const settings = await getAISettings()

  return <GeneralSettingsClient initialSettings={settings} />
}
