'use client';
import React from 'react';
import { useCollections } from '@/editor/hooks/use-shopify-collections';
import CollectionCard from './collection-card';
const Collections: React.FC = () => {
const { collections, loading, error, refetch } = useCollections(20);
if (loading) {
return (
Our Collections
{/* Loading Skeleton */}
{Array.from({ length: 6 }).map((_, index) => (
))}
);
}
if (error) {
return (
Could not load collections
{error}
);
}
if (collections.length === 0) {
return (
Our Collections
No Collections Found
Check back later or configure your Shopify store connection.
);
}
return (
Our Collections
{/* Collections Grid */}
{collections.map((collection) => (
))}
);
};
export default Collections;