import React from 'react' const FALLBACK = 'https://files.skinbase.org/default/missing_md.webp' const AVATAR_FALLBACK = 'https://files.skinbase.org/default/avatar_default.webp' function ArtCard({ item }) { const username = item.author_username ? `@${item.author_username}` : null return (
{item.title} { e.currentTarget.src = FALLBACK }} />
{item.title}
{item.author} { e.currentTarget.src = AVATAR_FALLBACK }} /> {item.author} {username && {username}}
{item.title} by {item.author}
) } /** * Personalized trending: artworks matching user's top tags, sorted by trending score. * Label and browse link adapt to the user's first top tag. */ export default function HomeTrendingForYou({ items, preferences }) { if (!Array.isArray(items) || items.length === 0) return null const topTag = preferences?.top_tags?.[0] const heading = topTag ? `🎯 Trending in #${topTag}` : '🎯 Trending For You' const link = topTag ? `/browse?tags=${encodeURIComponent(topTag)}&sort=trending` : '/discover/trending' return (

{heading}

See all →
{items.slice(0, Math.floor(items.length / 5) * 5 || items.length).map((item) => ( ))}
) }