optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -1,23 +1,26 @@
import React from 'react'
import ArtworkGalleryGrid from '../../components/artwork/ArtworkGalleryGrid'
/**
* 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'
const heading = 'Picked For You'
const subheading = topTag
? `Fresh recommendations informed by your recent interest in #${topTag}.`
: 'A live preview of your personalized discovery feed.'
const link = '/discover/for-you'
return (
<section className="mt-14 px-4 sm:px-6 lg:px-8">
<div className="mb-5 flex items-center justify-between">
<h2 className="text-xl font-bold text-white">{heading}</h2>
<a href={link} className="text-sm text-nova-300 hover:text-white transition">
See all
<div className="mb-5 flex flex-col gap-3 md:flex-row md:items-end md:justify-between">
<div>
<p className="text-[0.7rem] font-semibold uppercase tracking-[0.28em] text-sky-200/70">Personalized feed</p>
<h2 className="mt-2 text-xl font-bold text-white">{heading}</h2>
<p className="mt-1 max-w-2xl text-sm text-slate-300">{subheading}</p>
</div>
<a href={link} className="text-sm text-nova-300 transition hover:text-white">
Open full feed
</a>
</div>
<ArtworkGalleryGrid items={items.slice(0, 8)} compact />