import { cookies } from "next/headers"
import { redirect } from "next/navigation"
import { auth } from "@/auth"
import { prisma } from "@/lib/prisma"
import { verifyJoinLinkToken } from "@/lib/join-link"
import { guestIdentityCookieName } from "@/lib/participant-identity"
import { AppShell } from "@/components/shell/app-shell"
import {
Card,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { JoinFlow } from "@/components/join/join-flow"
// Reads the session/cookies and queries the DB on every request to
// resolve "who is this visitor and what's their access state" — same
// reasoning as the dashboard page (see its own comment) for opting out
// of Cache Components' static-shell validation.
export const instant = false
function JoinShell({
title,
children,
}: {
title?: string
children: React.ReactNode
}) {
return (