import { createSupabaseServerClient } from "@/lib/supabase/server"
import { redirect } from "next/navigation"
import { SettingsShell } from "./_components/settings-shell"

export default async function SettingsPage() {
  const supabaseClient = await createSupabaseServerClient()
  const {
    data: { user },
  } = await supabaseClient.auth.getUser()

  if (!user) {
    redirect("/sign-in")
  }

  return <SettingsShell />
}
