import React from 'react'
import ProductDetailsSection from "@/features/product-details/ui/product-details-section";
import {ContactSection, DownloadAppSection, FreeRecommendationSection, PartnersSection} from "@/features/home/ui";
import {getProductById} from "@/shared/api/productSvc";
import { getBrands } from '@/shared/api/brandsSvc';

export const dynamic = "force-dynamic";

type PageProps = {
  params: {
    productId: number
  },
};

const Page = async ({params}: Readonly<PageProps>) => {
  const {productId} = await params;
  const {data: product} = await getProductById(productId)
  const { data: partners } = await getBrands();

  return (
      <div className={"section-wrapper bg-white"}>
        <ProductDetailsSection product={product.data}/>
        <FreeRecommendationSection/>
        <div className="mt-24">
          <PartnersSection partners={partners}/>
        </div>
        <ContactSection/>
        <DownloadAppSection/>
      </div>
  )
}
export default Page
