import { e as createComponent, k as renderComponent, r as renderTemplate, h as createAstro, m as maybeRenderHead, g as addAttribute } 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 { b as getBrandBySlugFromDB, c as getModelsByBrand, g as getProductsFromDB } from '../../../chunks/products_DQrRaeeW.mjs';
export { renderers } from '../../../renderers.mjs';

const $$Astro = createAstro();
const $$model = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$model;
  const { slug, model: modelSlug } = Astro2.params;
  const dbBrand = await getBrandBySlugFromDB(slug);
  if (!dbBrand) return Astro2.redirect("/merken");
  const brandName = dbBrand.name;
  const models = await getModelsByBrand(slug);
  const modelInfo = models.find((m) => m.slug === modelSlug);
  if (!modelInfo) return Astro2.redirect(`/merken/${slug}`);
  const modelName = modelInfo.name;
  const products = await getProductsFromDB({ limit: 48, brand: slug, model: modelName });
  const title = `${brandName} ${modelName} \u2014 Vergelijk Prijzen | SneakerPicks`;
  const description = `Vergelijk ${brandName} ${modelName} prijzen bij Nederlandse webshops. ${products.length} varianten beschikbaar.`;
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": title, "description": description }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<section class="relative overflow-hidden"> <div class="absolute inset-0 bg-gradient-to-b from-accent/5 via-transparent to-transparent"></div> <div class="relative mx-auto max-w-7xl px-4 py-16 sm:px-6"> <nav class="mb-4 text-sm text-text-muted"> <a href="/merken" class="hover:text-accent transition-colors">Merken</a> <span class="mx-2">/</span> <a${addAttribute(`/merken/${slug}`, "href")} class="hover:text-accent transition-colors">${brandName}</a> <span class="mx-2">/</span> <span class="text-text-secondary">${modelName}</span> </nav> <h1 class="text-4xl font-black tracking-tight sm:text-5xl">${brandName} ${modelName}</h1> <p class="mt-2 text-text-secondary">${products.length} sneakers gevonden · Prijzen vergelijken</p> </div> </section> <section class="mx-auto max-w-7xl px-4 pb-16 sm:px-6"> <div class="grid grid-cols-2 gap-4 sm:gap-6 md:grid-cols-3 lg:grid-cols-4"> ${products.map((sneaker, i) => renderTemplate`${renderComponent($$result2, "ProductCard", $$ProductCard, { "sneaker": sneaker, "index": i })}`)} </div> ${products.length === 0 && renderTemplate`<div class="py-20 text-center"> <p class="text-lg text-text-muted">Geen sneakers gevonden voor ${brandName} ${modelName}.</p> </div>`} </section> ` })}`;
}, "C:/Users/Roel/clawd/sneakerpicks/src/pages/merken/[slug]/[model].astro", void 0);

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

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

const page = () => _page;

export { page };
