import { getTranslations } from "next-intl/server"; import { auth } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; import { headers } from "next/headers"; export default async function Dashboard() { const t = await getTranslations('Dashboard'); // Get user session and profile const session = await auth.api.getSession({ headers: await headers() }); let userProfile = null; if (session?.user) { userProfile = await prisma.userProfile.findUnique({ where: { userId: session.user.id }, include: { role: true } }); } console.log("User Profile:", userProfile); return (

{t('welcomeTitle')}

{t('welcomeSubtitle')}

{/* Show role registration options for general users */} {userProfile?.role?.name === 'UMUM' || userProfile === null && (

Upgrade Akun Anda

Pilih role untuk mengakses fitur lengkap kreatiVortex

Daftar sebagai Calon Pendidik Daftar sebagai Pendidik
)}
{/* Recent Activity */}
{/* Recent Videos */}

{t('recentVideosTitle')}

{t('sampleVideo1')}

{t('timeAgo', {hours: 2})}

{t('sampleVideo2')}

{t('timeAgo', {hours: 5})}

{/* Recent Forum Posts */}

{t('recentDiscussionsTitle')}

{t('sampleDiscussion1Title')}

{t('sampleDiscussion1Content')}

Oleh Sarah Pendidik • {t('timeAgo', {hours: 1})}

{t('sampleDiscussion2Title')}

{t('sampleDiscussion2Content')}

Oleh Budi Student • {t('timeAgo', {hours: 3})}

); }