import { ProductRecommendationCarousel } from "@/components/showcase/ProductRecommendationCarousel";
import { searchProducts } from "@/lib/product-actions";
import { CartDetails } from "@/components/cart/CartDetails";

export default async function CartPage() {
  const response = await searchProducts({ 
    page: 1, 
    pageSize: 10, 
    requestType: "display",
    sortOrder: "ASC"
  });  
  const recommendedProducts = response.success ? response.data.documents : [];

  return (
    <div className="mx-auto max-w-screen-xl min-h-screen">
      <CartDetails />
      <div className="mt-[17vh]">
        <h2 className="text-xl sm:text-2xl font-bold my-4 sm:my-6 text-center sm:text-left px-4">
          Produkte Entdecken!
        </h2>
        <div className="m-4">
          <ProductRecommendationCarousel initialProducts={recommendedProducts} />
        </div>
      </div>
    </div>
  );
}
