'use client'; import React from 'react'; import { useProductRecommendations } from '@/hooks/use-shopify-products'; import ProductCard from '../product-card'; interface ProductRecommendationsProps { productId: string; } const ProductRecommendations: React.FC = ({ productId }) => { const { recommendations, loading, error } = useProductRecommendations(productId); // Don't show section if we're not loading and have no recommendations if (!loading && (!recommendations || recommendations.length === 0)) { return null; } return (

You Might Also Like

{loading ? (
{Array.from({ length: 4 }).map((_, index) => (
))}
) : error ? (

Recommendations could not be loaded

) : (
{recommendations.slice(0, 4).map((recommendedProduct) => ( ))}
)}
); }; export default ProductRecommendations;