import SendInviteForm from '@/components/SendInviteForm'; import { prisma } from '@/lib/prisma'; import { notFound } from 'next/navigation'; import React from 'react' export default async function UserPage({ params }: { params: { username: string } }) { const raw = params.username const username = raw.startsWith('@') ? raw.slice(1) : raw const user = await prisma.user.findUnique({ where: { username }, select: { id: true, email: true, name: true, role: true, createdAt: true, }, }) if (!user) notFound() return ( <>
Email: {user.email}
Role: {user.role}
Joined: {user.createdAt.toDateString()}