page.tsx
564 bytes
| 1 | import { NewDebate } from '@/components/debate/new-debate'; |
|---|---|
| 2 | |
| 3 | export const dynamic = 'force-dynamic'; |
| 4 | |
| 5 | export default async function DebatePage({ |
| 6 | searchParams, |
| 7 | }: { |
| 8 | searchParams: Promise<{ from?: string | string[]; q?: string | string[] }>; |
| 9 | }) { |
| 10 | const { from, q } = await searchParams; |
| 11 | const fromDebateId = Array.isArray(from) ? from[0] : from; |
| 12 | const initialQuestion = Array.isArray(q) ? q[0] : q; |
| 13 | return ( |
| 14 | <div className="container py-8 sm:py-12"> |
| 15 | <NewDebate fromDebateId={fromDebateId} initialQuestion={initialQuestion} /> |
| 16 | </div> |
| 17 | ); |
| 18 | } |
| 19 | |