'use client'; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { products, categories } from '@/data/products'; import LoadingSpinner from './LoadingSpinner'; import 'react-awesome-slider/dist/styles.css'; import AwesomeSlider from 'react-awesome-slider'; const ProductsPage = () => { const [selectedCategory, setSelectedCategory] = useState('All'); // const [selectedProduct, setSelectedProduct] = useState(null); const [isLoading, setIsLoading] = useState(false); const filteredProducts = selectedCategory === 'All' ? products : products.filter(product => product.category === selectedCategory); const handleCategoryChange = (category: string) => { setIsLoading(true); setSelectedCategory(category); // Simulate loading state setTimeout(() => setIsLoading(false), 500); }; return (
{/* Hero Section */}

Products

Explore our wide range of products crafted with the finest ingredients. Whether you are looking for something sweet or savory, we have something for everyone. Browse through our categories to find your perfect treat.

{/* Products Section */}
{/* Categories */}
{categories.map((category) => ( handleCategoryChange(category)} className={`px-6 py-2 rounded-full border-2 transition-colors ${ selectedCategory === category ? 'bg-bakery-600 text-white border-bakery-600' : 'border-bakery-600 text-bakery-600 hover:bg-bakery-600 hover:text-white' }`} > {category} ))}
{/* Products Grid */} {isLoading ? (
) : ( {filteredProducts.map((product) => ( {/* Image Container */}
1} customContent={true} buttonContentLeft={product.images.length > 1 ? {'<'} : null} buttonContentRight={product.images.length > 1 ? {'>'} : null} > {product.images.map((image, index) => (
))}
{/* Content */}

{product.name}

{product.category}
))} )}
{/* Product Modal */} {/* setSelectedProduct(null)} /> */}
); }; export default ProductsPage;