import { notFound, redirect } from 'next/navigation' import { getTranslations, setRequestLocale } from 'next-intl/server' import { getForum, getForumPath } from '@/lib/forum' import { getSession } from '@/lib/session' import { PageShell } from '@/components/PageShell' import { ForumBreadcrumb } from '@/components/ForumBreadcrumb' import { CreateTopicForm } from '@/components/CreateTopicForm' export const dynamic = 'force-dynamic' export default async function CreateTopicPage({ params, }: { params: Promise<{ locale: string; forumId: string }> }) { const { locale, forumId } = await params setRequestLocale(locale) const t = await getTranslations('Forum') const id = Number(forumId) const forum = await getForum(id) if (!forum) notFound() const session = await getSession() if (!session.username) redirect(`/${locale}/forum/${id}`) const path = await getForumPath(id) return (
{path && ( )}

{forum.name}

{forum.description &&

{forum.description}

}
) }