/** * File: page.tsx * Created by: AI Assistant * Date: 2025-11-29 * Purpose: Forum list page for kreatiVortex platform * Part of: kreatiVortex - Platform Pembelajaran Tari Online */ 'use client'; import { Link } from '@/i18n/routing'; import ActionButton from '@/components/ActionButton'; import { useFetch } from '@/hooks/useFetch'; import { useTranslations } from 'next-intl'; interface ForumData { id: string; title: string; creator: { user: { name: string; }; }; _count: { posts: number; }; updatedAt: string; type: string; } export default function ForumPage() { const t = useTranslations('Forum'); const { data: forums, loading } = useFetch('/api/forums?type=GENERAL'); return (

{t('generalForum')}

{t('generalForumSubtitle')}

{t('createButton')}
{loading ? (
Loading...
) : (
{forums?.map((forum) => (
{forum.type}

{forum.title}

{forum.creator.user.name.charAt(0)} {forum.creator.user.name} {new Date(forum.updatedAt).toLocaleDateString()}
{forum._count.posts}
{t('posts')}
))} {(!forums || forums.length === 0) && (
{t('noForums')}
)}
)}
); }