veza/apps/web/dist_verification/assets/WishlistView-BrN3xAjD.js
2026-02-07 20:36:48 +01:00

1 line
4.1 KiB
JavaScript

import{a as d,j as e}from"./vendor-react-YMhRUmcb.js";import{m as p,B as r,C as f}from"./index-D2uzyr9g.js";import{u as g}from"./cartStore-C2PNCAMv.js";import{E as j,b8 as v,V as b,Y as w,aZ as N,T as y}from"./vendor-icons-DINCNwpk.js";import"./vendor-fFnFILYR.js";import"./vendor-router-DX94Iu-2.js";import"./vendor-tanstack-CoFNL2zy.js";import"./vendor-utils-4BWoYre8.js";const C=[{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,coverUrl:"https://picsum.photos/id/50/300/300",author:"Sound Design Co",isHot:!0,description:"Impacts, risers, and drops.",features:[],licenses:[]}],E=()=>{const i=g(s=>s.addItem),{addToast:a}=p(),[t,l]=d.useState(C),[o,c]=d.useState(null),n=s=>{l(h=>h.filter(u=>u.id!==s)),a("Removed from wishlist","info")},m=s=>{i(s),n(s.id)},x=()=>{t.forEach(s=>i(s)),l([]),a("All items moved to cart","success")};return t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-center animate-fadeIn",children:[e.jsx("div",{className:"w-24 h-24 bg-muted rounded-full flex items-center justify-center mb-6 border-2 border-dashed border-border",children:e.jsx(j,{className:"w-10 h-10 text-muted-foreground"})}),e.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Your wishlist is empty"}),e.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Save items you want to listen to later or purchase in the future."})]}):e.jsxs("div",{className:"animate-fadeIn max-w-6xl mx-auto pb-20",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end border-b border-border/50 pb-6 gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-white mb-2",children:"WISHLIST"}),e.jsxs("p",{className:"text-muted-foreground font-mono text-sm",children:[t.length," saved items"]})]}),e.jsx(r,{variant:"primary",icon:e.jsx(v,{className:"w-4 h-4"}),onClick:x,children:"ADD ALL TO CART"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(s=>e.jsxs(f,{variant:"default",className:"p-4 group hover:border-border/50 transition-all",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative w-24 h-24 bg-muted rounded-lg overflow-hidden flex-shrink-0",children:[e.jsx("img",{src:s.coverUrl,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-500"}),e.jsx("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",onClick:()=>c(o===s.id?null:s.id),children:o===s.id?e.jsx(b,{className:"w-8 h-8 text-white"}):e.jsx(w,{className:"w-8 h-8 text-white fill-current"})}),s.isHot&&e.jsxs("div",{className:"absolute top-1 left-1 bg-warning text-warning-foreground text-xs font-bold px-1.5 py-0.5 rounded",children:[e.jsx(N,{className:"w-2 h-2 inline"})," HOT"]})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white truncate",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.author}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 capitalize",children:s.type})]}),e.jsxs("div",{className:"text-lg font-mono font-bold text-muted-foreground",children:["$",s.price]})]})]}),e.jsxs("div",{className:"flex gap-2 mt-4 pt-4 border-t border-kodo-steel/30",children:[e.jsx(r,{variant:"secondary",size:"sm",className:"flex-1",onClick:()=>m(s),children:"Add to Cart"}),e.jsx(r,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(s.id),children:e.jsx(y,{className:"w-4 h-4"})})]})]},s.id))})]})};export{E as WishlistView};