| 1 |
import { RecommendationCard } from '@recommendations/components/RecommendationCard'; |
| 2 |
|
| 3 |
export const RecommendationsGrid = ({ recommendations }) => { |
| 4 |
return ( |
| 5 |
<div |
| 6 |
className="grid grid-cols-1 gap-4 px-6 pb-8 md:grid-cols-2 3xl:grid-cols-3 5xl:grid-cols-4" |
| 7 |
data-test="extendify-recommendations-grid" |
| 8 |
> |
| 9 |
{recommendations.map((recommendation) => |
| 10 |
// Don't render the card if the CTA type is not supported. |
| 11 |
['plugin', 'external-link', 'internal-link'].includes( |
| 12 |
recommendation.ctaType, |
| 13 |
) ? ( |
| 14 |
<RecommendationCard key={recommendation.slug} {...recommendation} /> |
| 15 |
) : null, |
| 16 |
)} |
| 17 |
</div> |
| 18 |
); |
| 19 |
}; |
| 20 |
|