Files
Atomcms-edit/frontend/.next/static/chunks/0q6o6pz9rphu3.js
T
2026-05-09 17:32:17 +02:00

1 line
5.6 KiB
JavaScript
Executable File

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6695,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(57688),l=e.i(88589),i=e.i(13642),r=e.i(9165);e.s(["default",0,function(){let[e,n]=(0,s.useState)([]),[c,d]=(0,s.useState)([]),[o,x]=(0,s.useState)(!0),[m,h]=(0,s.useState)(null),[u,p]=(0,s.useState)(null);(0,s.useEffect)(()=>{!async function(){try{let[e,t]=await Promise.all([r.api.get("/shop/packages"),r.api.get("/shop/categories")]);e.error||t.error?h("Er is een fout opgetreden bij het laden van de winkel"):(t.data&&d(t.data),e.data&&n(e.data))}catch{h("Er is een fout opgetreden bij het laden van de winkel")}x(!1)}()},[]);let g=u?e.filter(e=>e.category_id===u):e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.default,{}),(0,t.jsx)("main",{className:"bg-background min-h-screen",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto p-4 lg:p-6",children:[(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-4 md:p-6 mb-6",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 100 4 2 2 0 000-4z"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl md:text-3xl font-bold text-text-main",children:"Winkel"}),(0,t.jsx)("p",{className:"text-text-muted",children:"Koop unieke pakketten met credits en diamanten"})]})]})}),o?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Winkel laden..."})}):m?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-danger",children:m})}):(0,t.jsxs)(t.Fragment,{children:[c.length>0&&(0,t.jsxs)("div",{className:"flex gap-2 mb-6 overflow-x-auto pb-2",children:[(0,t.jsx)("button",{onClick:()=>p(null),className:`px-4 py-2 rounded-lg font-semibold whitespace-nowrap transition-colors ${null===u?"bg-primary text-text-main":"bg-surface text-text-muted hover:bg-gray-100"}`,children:"Alles"}),c.map(e=>(0,t.jsx)("button",{onClick:()=>p(e.id),className:`px-4 py-2 rounded-lg font-semibold whitespace-nowrap transition-colors ${u===e.id?"bg-primary text-text-main":"bg-surface text-text-muted hover:bg-gray-100"}`,children:e.name},e.id))]}),g.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:g.map(e=>(0,t.jsxs)("div",{className:"bg-surface rounded-lg shadow-card overflow-hidden group hover:scale-[101%] transition-all duration-200",children:[(0,t.jsx)("div",{className:"aspect-video relative bg-background overflow-hidden",children:e.image?(0,t.jsx)(a.default,{src:`/storage/${e.image}`,alt:e.name,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}):(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-16 h-16 text-text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})})})}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:e.name}),e.description&&(0,t.jsx)("p",{className:"text-sm text-text-muted mt-1 line-clamp-2",children:e.description}),e.items.length>0&&(0,t.jsxs)("ul",{className:"mt-3 space-y-1",children:[e.items.slice(0,3).map((e,s)=>(0,t.jsxs)("li",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,t.jsx)("svg",{className:"w-3 h-3 text-accent",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e]},s)),e.items.length>3&&(0,t.jsxs)("li",{className:"text-xs text-primary",children:["+",e.items.length-3," meer..."]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-gray-100",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[e.price_credits>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("svg",{className:"w-4 h-4 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("circle",{cx:"10",cy:"10",r:"8"})}),(0,t.jsxs)("span",{className:"text-sm font-semibold text-text-main",children:[e.price_credits.toLocaleString()," credits"]})]}),e.price_diamonds>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("svg",{className:"w-4 h-4 text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{d:"M10 2l3 4h4l-3 5 1 5-5-3-5 3 1-5-3-5h4z"})}),(0,t.jsxs)("span",{className:"text-sm font-semibold text-text-main",children:[e.price_diamonds.toLocaleString()," ","diamanten"]})]})]}),(0,t.jsx)("button",{className:"px-4 py-2 bg-primary text-text-main rounded-lg font-semibold text-sm hover:bg-primary-hover transition-colors",children:"Kopen"})]})]})]},e.id))}):(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Geen pakketten beschikbaar in deze categorie"})})]})]})}),(0,t.jsx)(i.default,{})]})}])}]);