Show loading skeletons instead of empty state when product or collection is missing

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DoqTD6MbXbwpCofyqwvELd
This commit is contained in:
Rami Bitar
2026-08-15 16:58:14 -04:00
co-authored by Claude Opus 5
parent bd7e6810b7
commit ebb07c40fc
2 changed files with 7 additions and 32 deletions
+4 -3
View File
@@ -160,7 +160,10 @@ const CollectionDetail: React.FC<CollectionDetailProps> = ({
</div>
<div className="mt-8">
{loading ? (
{/* A missing or failed collection keeps the skeletons up rather than
showing an empty state, so the page stays presentable while a
handle is being chosen. */}
{loading || error ? (
<div className={GRID_CLASSES}>
{Array.from({ length: 10 }).map((_, index) => (
<div key={index} className="animate-pulse">
@@ -172,8 +175,6 @@ const CollectionDetail: React.FC<CollectionDetailProps> = ({
</div>
))}
</div>
) : error ? (
<p className="text-sm text-muted-foreground">{error}</p>
) : products.length === 0 ? (
<p className="text-sm text-muted-foreground">
{activeFilters.length > 0