'use client'; import React from 'react'; import { useCollections } from '@/hooks/use-shopify-collections'; import CollectionCard from './collection-card'; import { Button } from '@/components/ui/button'; interface CollectionsProps { title?: string; subtitle?: string; } const SectionHeader: React.FC<{ title: string; subtitle?: string }> = ({ title, subtitle, }) => ( <>

{title}

{subtitle && (

{subtitle}

)} ); const GRID_CLASSES = 'grid grid-cols-2 lg:grid-cols-4 gap-x-8 gap-y-12'; const Collections: React.FC = ({ title = 'Our Collections', subtitle = 'Discover our carefully crafted worlds', }) => { const { collections, loading, error, refetch } = useCollections(12); if (loading) { return (
{Array.from({ length: 8 }).map((_, index) => (
))}
); } if (error) { return (

{error}

); } if (collections.length === 0) { return (

Collections will appear here once added to your Shopify store.

); } return (
{collections.map((collection) => ( ))}
); }; export default Collections;