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('welcomeSubtitle')}
{/* Show role registration options for general users */} {userProfile?.role?.name === 'UMUM' || userProfile === null && (Pilih role untuk mengakses fitur lengkap kreatiVortex
{t('timeAgo', {hours: 2})}
{t('timeAgo', {hours: 5})}
{t('sampleDiscussion1Content')}
Oleh Sarah Pendidik • {t('timeAgo', {hours: 1})}
{t('sampleDiscussion2Content')}
Oleh Budi Student • {t('timeAgo', {hours: 3})}