import { getTranslations, setRequestLocale } from 'next-intl/server' import { Link } from '@/i18n/navigation' import { getForumIndex } from '@/lib/forum' import { ForumSearchBox } from '@/components/ForumSearchBox' export const dynamic = 'force-dynamic' export default async function ForumIndexPage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations('Forum') const categories = await getForumIndex() return (

{t('title')}

{categories.length === 0 ? (

{t('noForums')}

) : ( categories.map((cat) => (

{cat.name}

    {cat.forums.map((f) => (
  • {f.name} {f.description &&

    {f.description}

    }
    {f.topic_count} {t('topics')} ยท {f.post_count} {t('posts')}
    {f.last_topic_id && (
    {f.last_topic_name} {' '} {t('by')} {f.last_topic_poster}
    )}
  • ))}
)) )}
) }