import { getSession } from "@auth0/nextjs-auth0"
import PostHogClient from "@/lib/posthog"
import GettingStartedClient from "./getting-started-client"

export default async function GettingStarted() {
  const session = await getSession()
  if (!session) return null

  const userId = session.user.sub
  const posthog = PostHogClient()
  posthog?.capture({
    distinctId: userId,
    properties: { username: session.nickname },
    event: "webapp-loaded-getting-started",
  })

  await posthog?.shutdown()

  return <GettingStartedClient />
}
