import Image from "next/image"; import { notFound } from "next/navigation"; import { getServerSession } from "next-auth"; import { getUserWithRelations } from "@/lib/services/userService"; import ProfileTabsClient from "@/lib/components/folderComponents/profilTabsComponent"; import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import { Prisma } from "@prisma/client"; export default async function ProfilPage({ params }: { params: { id: string } }) { const userId = Number(params.id); const session = await getServerSession(authOptions); const user = await getUserWithRelations(userId); if (!user) return notFound(); const isOwner = Number(session?.user?.id) === user.id; return (
img

{user.firstName} {user.lastName}

Membre depuis {new Date(user.createdAt).toLocaleDateString("fr-FR")}

{user.email}

{isOwner && (
Éditer le profil {["ADMIN", "AGENT"].includes(user.role) && ( Nouvelle annonce )}
)}
); } function StatCard({ label, value }: { label: string; value: number }) { return (
{label}
{value}
); }