import { c as createComponent, r as renderComponent, a as renderTemplate, b as createAstro, m as maybeRenderHead, d as addAttribute } from '../../chunks/astro/server_i-dTRwm2.mjs';
import 'piccolore';
import { r as renderEntry, g as getCollection } from '../../chunks/_astro_content_BWFO8YAR.mjs';
import { $ as $$BaseLayout } from '../../chunks/BaseLayout_rqQLf6w4.mjs';
export { renderers } from '../../renderers.mjs';

const $$Astro = createAstro();
async function getStaticPaths() {
  const posts = await getCollection("blog");
  return posts.map((post) => ({
    params: { slug: post.id },
    props: { post }
  }));
}
const $$slug = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$slug;
  const { post } = Astro2.props;
  const { Content } = await renderEntry(post);
  const { title, date, author, category, categories, image, featuredImage } = post.data;
  const postCategory = category || (Array.isArray(categories) ? categories[0] : "\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B");
  const postImage = image || featuredImage || "/images/2021/03/ppr-pipe_000C.jpg";
  return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, { "title": title, "description": post.data.excerpt }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<main class="pt-32 pb-16"> <article class="container mx-auto px-4 max-w-4xl"> <!-- Header --> <header class="mb-8"> <div class="flex items-center gap-4 mb-4"> <span class="industrial-badge">${postCategory}</span> <time class="text-secondary-500"> ${new Date(date).toLocaleDateString("th-TH", {
    year: "numeric",
    month: "long",
    day: "numeric"
  })} </time> <span class="text-secondary-500">•</span> <span class="text-secondary-500">${author}</span> </div> <h1 class="text-4xl md:text-5xl font-bold text-secondary-900 mb-4"> ${title} </h1> </header> <!-- Featured Image --> <div class="relative aspect-video bg-secondary-100 rounded-xl overflow-hidden mb-8"> <img${addAttribute(postImage, "src")}${addAttribute(title, "alt")} class="object-cover w-full h-full" loading="lazy"> </div> <!-- Content --> <div class="prose prose-lg max-w-none prose-headings:font-bold prose-a:text-primary-600 hover:prose-a:text-primary-700 prose-img:rounded-xl"> ${renderComponent($$result2, "Content", Content, {})} </div> <!-- Back to Blog --> <div class="mt-12 pt-8 border-t border-secondary-200"> <a href="/blog/" class="inline-flex items-center text-primary-600 font-medium hover:text-primary-700 transition-colors"> <svg class="w-5 h-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round"${addAttribute(2, "stroke-width")} d="M10 19l-7-7m0 0l7-7m-7 7h18"></path> </svg>
กลับสู่หน้าบทความ
</a> </div> </article> </main> ` })}`;
}, "/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/blog/[slug].astro", void 0);

const $$file = "/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/blog/[slug].astro";
const $$url = "/blog/[slug]";

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

const page = () => _page;

export { page };
