import React from 'react' import CollectionCard from '../../components/profile/collections/CollectionCard' function normalizeItems(items) { if (!Array.isArray(items)) return [] return items.filter((item) => item && typeof item === 'object') } export default function HomeCollections({ featured, recent, trending, editorial, community, }) { const featuredItems = normalizeItems(featured) const recentItems = normalizeItems(recent) const trendingItems = normalizeItems(trending) const editorialItems = normalizeItems(editorial) const communityItems = normalizeItems(community) const displayItems = ( trendingItems.length ? trendingItems : featuredItems.length ? featuredItems : recentItems.length ? recentItems : editorialItems.length ? editorialItems : communityItems ).slice(0, 3) if (!displayItems.length) { return null } return (

Trending Collections

Collections getting the strongest mix of follows, saves, and engagement right now.

All collections →
{displayItems.map((collection) => ( ))}
) }