import { redirect } from "next/navigation"
import { createSupabaseServerClient } from "@/lib/supabase/server"
import { SharesContent } from "./_components/shares-content"

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

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

  return <SharesContent />
}
