export const dynamic = 'force-dynamic';
import { prisma } from '@/lib/prisma';
import { ContactClient } from './contact-client';

export default async function ContactPage({ searchParams }: { searchParams: any }) {
  let vehicle: any = null;
  try {
    if (searchParams?.vehicle) {
      vehicle = await prisma.vehicle.findUnique({
        where: { id: searchParams.vehicle },
        select: { id: true, title: true },
      });
    }
  } catch {}
  return <ContactClient vehicle={vehicle ? JSON.parse(JSON.stringify(vehicle)) : null} />;
}
