import { Button } from '../ui/button'; import { Card } from '../ui/card'; import { EmptyState } from '../ui/empty-state'; 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 { useToast } from '../../components/feedback/ToastProvider'; // 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 [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 (wishlist.length === 0) { return ( } title="Your wishlist is empty" description="Save items you want to listen to later or purchase in the future." size="lg" className="min-h-96 animate-fadeIn" /> ); } 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}
))}
); };