import { notFound } from 'next/navigation' import { getTranslations, setRequestLocale } from 'next-intl/server' import { Link } from '@/i18n/navigation' import { getTopic, getPosts } from '@/lib/forum' export const dynamic = 'force-dynamic' export default async function TopicPage({ params, }: { params: Promise<{ locale: string; topicId: string }> }) { const { locale, topicId } = await params setRequestLocale(locale) const t = await getTranslations('Forum') const id = Number(topicId) const topic = await getTopic(id) if (!topic) notFound() const posts = await getPosts(id) return (

← {t('backToForum')}

{topic!.locked && [{t('locked')}]} {topic!.name}

{posts.map((post) => (
{post.poster} {post.time && ( {new Date(post.time).toLocaleString(locale)} )}
))}
) }