import { e as createComponent, k as renderComponent, r as renderTemplate, h as createAstro, m as maybeRenderHead } from '../../chunks/astro/server_DePCulMI.mjs';
import 'piccolore';
import { $ as $$Layout } from '../../chunks/Layout_DxAv3UTa.mjs';
import { $ as $$ProductCard } from '../../chunks/ProductCard_7e_PI4fu.mjs';
import { g as getProductsFromDB, a as getPriceDropsFromDB } from '../../chunks/products_DQrRaeeW.mjs';
export { renderers } from '../../renderers.mjs';

const $$Astro = createAstro();
const $$slug = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$slug;
  const collectionMeta = {
    "sale": { title: "Sale", description: "De beste sneaker deals met meer dan 15% korting" },
    "trending": { title: "Trending", description: "De populairste sneakers van dit moment" },
    "new-arrivals": { title: "Nieuw Binnen", description: "De nieuwste sneakers, net toegevoegd" },
    "price-drops": { title: "Prijsdalingen", description: "Sneakers die recent in prijs zijn gedaald" },
    "bestsellers": { title: "Bestsellers", description: "De best verkochte sneakers" },
    "under-100": { title: "Onder \u20AC100", description: "Betaalbare sneakers onder de honderd euro" }
  };
  const { slug } = Astro2.params;
  const meta = collectionMeta[slug] || { title: slug, description: "" };
  let collectionProducts = [];
  switch (slug) {
    case "sale":
    case "price-drops":
      collectionProducts = await getPriceDropsFromDB(24);
      break;
    case "trending":
    case "bestsellers":
      collectionProducts = await getProductsFromDB({ limit: 24, orderBy: "popular" });
      break;
    case "new-arrivals":
      collectionProducts = await getProductsFromDB({ limit: 24, orderBy: "newest" });
      break;
    case "under-100":
      collectionProducts = await getProductsFromDB({ limit: 24, orderBy: "price_asc" });
      collectionProducts = collectionProducts.filter((s) => s.lowestPrice < 100);
      break;
    default:
      collectionProducts = await getProductsFromDB({ limit: 24 });
  }
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": `${meta.title} \u2014 SneakerPicks`, "description": meta.description }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<section class="mx-auto max-w-7xl px-4 py-12 sm:px-6"> <div class="mb-8"> <h1 class="text-3xl font-black tracking-tight sm:text-4xl"> <span>${meta.emoji}</span> ${meta.title} </h1> <p class="mt-2 text-text-secondary">${meta.description}</p> <p class="mt-1 text-sm text-text-muted">${collectionProducts.length} sneakers</p> </div> <div class="grid grid-cols-2 gap-4 sm:gap-6 md:grid-cols-3 lg:grid-cols-4"> ${collectionProducts.map((sneaker, i) => renderTemplate`${renderComponent($$result2, "ProductCard", $$ProductCard, { "sneaker": sneaker, "index": i })}`)} </div> ${collectionProducts.length === 0 && renderTemplate`<div class="py-20 text-center"> <p class="text-lg text-text-muted">Geen sneakers gevonden in deze collectie</p> </div>`} </section> ` })}`;
}, "C:/Users/Roel/clawd/sneakerpicks/src/pages/collecties/[slug].astro", void 0);

const $$file = "C:/Users/Roel/clawd/sneakerpicks/src/pages/collecties/[slug].astro";
const $$url = "/collecties/[slug]";

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  default: $$slug,
  file: $$file,
  url: $$url
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
