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:
co-authored by
Claude Opus 5
parent
bd7e6810b7
commit
ebb07c40fc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user