import { isSetupNeeded } from '@/lib/actions/setup'
import { redirect } from 'next/navigation'
import { SetupWizard } from '@/components/SetupWizard'

export const dynamic = 'force-dynamic'

export default async function SetupPage() {
  const needed = await isSetupNeeded()

  if (!needed) {
    redirect('/')
  }

  return <SetupWizard />
}
