Defer profile featured artworks

This commit is contained in:
2026-08-29 16:33:36 +02:00
parent ff80f5bf97
commit 872f420190
7 changed files with 336 additions and 39 deletions
@@ -242,7 +242,7 @@ function FullGalleryCta({ galleryUrl, username }) {
)
}
export default function TabArtworks({ artworks, featuredArtworks, username, galleryUrl }) {
export default function TabArtworks({ artworks, featuredArtworks, featuredLoading = false, featuredError = false, onRetryFeatured, username, galleryUrl }) {
const initialItems = artworks?.data ?? artworks ?? []
const trendingItems = useArtworkPreview(username, 'trending')
const popularItems = useArtworkPreview(username, 'views')
@@ -261,6 +261,16 @@ export default function TabArtworks({ artworks, featuredArtworks, username, gall
aria-labelledby="tab-artworks"
className="mx-auto max-w-7xl px-4 pt-2 pb-10 md:px-6"
>
{featuredLoading ? (
<div className="mb-8 rounded-[28px] border border-white/10 bg-white/[0.03] px-5 py-4 text-sm text-slate-400" role="status">
Loading featured artworks…
</div>
) : featuredError ? (
<div className="mb-8 rounded-[28px] border border-rose-400/20 bg-rose-400/10 px-5 py-4 text-sm text-rose-100" role="alert">
Featured artworks could not be loaded.
{onRetryFeatured ? <button type="button" className="ml-3 underline" onClick={onRetryFeatured}>Retry</button> : null}
</div>
) : null}
<FeaturedShowcase featuredArtworks={featuredArtworks ?? []} />
<PreviewRail