import { Button } from '../ui/button'; import { Card } from '../ui/card'; import { EmptyState } from '../ui/empty-state'; import { Skeleton } from '../ui/skeleton'; import { useCartStore } from '../../stores/cartStore'; import { Product } from '../../types'; import { Heart, Pause, Play, ShoppingCart, Trash2, Zap } from 'lucide-react'; import React, { useState } from 'react'; import { motion } from 'framer-motion'; import { useToast } from '../../components/feedback/ToastProvider'; const gridVariants = { visible: { transition: { staggerChildren: 0.06, delayChildren: 0.04 } }, }; const cardVariants = { hidden: { opacity: 0, y: 16, scale: 0.97 }, visible: { opacity: 1, y: 0, scale: 1, transition: { duration: 0.35, ease: [0.33, 1, 0.68, 1] as const }, }, }; // Mock Wishlist Data const MOCK_WISHLIST: any[] = [ { id: 'w1', title: 'Analog Dreams Vol. 2', type: 'sample_pack', price: 24.99, currency: 'USD', rating: 4.8, coverUrl: 'https://picsum.photos/id/40/300/300', author: 'Vintage Synths', description: 'Warm analog pads and leads.', features: [], licenses: [], }, { id: 'w2', title: 'Tech House Essentials', type: 'preset', price: 19.99, currency: 'USD', rating: 4.5, coverUrl: 'https://picsum.photos/id/45/300/300', author: 'Club Ready', description: 'Floor filling serum presets.', features: [], licenses: [], }, { id: 'w3', title: 'Cinematic FX', type: 'sample_pack', price: 34.5, currency: 'USD', rating: 5.0, coverUrl: 'https://picsum.photos/id/50/300/300', author: 'Sound Design Co', isHot: true, description: 'Impacts, risers, and drops.', features: [], licenses: [], }, ]; export const WishlistView: React.FC = () => { const addToCart = useCartStore((state) => state.addItem); const { addToast } = useToast(); const [isLoading] = useState(false); const [wishlist, setWishlist] = useState(MOCK_WISHLIST); const [playingPreview, setPlayingPreview] = useState(null); const handleRemove = (id: string) => { setWishlist((prev) => prev.filter((p) => p.id !== id)); addToast('Removed from wishlist', 'info'); }; const handleAddToCart = (product: Product) => { addToCart(product); handleRemove(product.id); }; const handleAddAll = () => { wishlist.forEach((p) => addToCart(p)); setWishlist([]); addToast('All items moved to cart', 'success'); }; if (isLoading) { return (
{[1, 2, 3].map((i) => ( ))}
); } if (wishlist.length === 0) { return ( } title="Your wishlist is empty" description="Explore the marketplace and save items you love." action={{ label: 'Browse Marketplace', onClick: () => (window.location.href = '/marketplace'), }} size="lg" className="min-h-96" /> ); } return (

WISHLIST

{wishlist.length} saved items

{wishlist.map((product) => (
setPlayingPreview( playingPreview === product.id ? null : product.id, ) } > {playingPreview === product.id ? ( ) : ( )}
{product.isHot && (
HOT
)}

{product.title}

{product.author}

{product.type}

${product.price}
))}
); };