// "use client" import React from 'react'; // import { useParams } from 'next/navigation'; import { MapPin, Calendar, Phone, MessageCircle, Share2, Flag, Heart } from 'lucide-react'; import { prisma } from '@/prisma/prisma-client'; import { notFound } from 'next/navigation'; import { ShowNumberModal } from '@/components/shared/modals/show-number'; type Params = Promise<{ id: string }> export default async function AdtPage(props: { params: Params }) { // const [ openShowNumberModal, setOpenShowNumberModal ] = React.useState(false) const params = await props.params; const adt = await prisma.adt.findFirst({ where: { id: Number(params.id), }, include: { user: true } }) if (!adt) { return notFound(); } const user = adt.user // const { id } = params(); // const adt = adts.find(l => l.id === id) || adts[0]; return ( <> {/* setOpenShowNumberModal(false)} /> */}
{adt.title}

{adt.title}

{adt.price}
{adt.location}
{String(adt.createdAt)}

Description

{adt.description}

Seller

{user?.name}

Member {String(user?.createdAt)}

); }