/* empty css                                          */
import { d as createAstro, c as createComponent, r as renderComponent, a as renderTemplate, m as maybeRenderHead, F as Fragment } from '../../../chunks/astro/server_5mFihzcn.mjs';
import { $ as $$MessageHeader } from '../../../chunks/MessageHeader_Cbxh23zH.mjs';
import { $ as $$Layout } from '../../../chunks/Layout_v67TeP9G.mjs';
import { g as getOneMessage } from '../../../chunks/message_DAReJ7u_.mjs';
export { renderers } from '../../../renderers.mjs';

const $$Astro = createAstro("https://new.sambekiel.com");
const prerender = false;
const $$slugMsgid = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$slugMsgid;
  const { searchParams } = Astro2.url;
  const { slug, id } = Astro2.params;
  const tab = searchParams.get("tab") ?? void 0;
  const getMsg = async () => {
    try {
      return await getOneMessage(Number(id));
    } catch (error) {
      console.error({ error });
    }
  };
  const data = await getMsg();
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": `${data?.chat?.subject ?? ""}` }, { "default": async ($$result2) => renderTemplate` ${renderComponent($$result2, "MessageHeader", $$MessageHeader, { "tab": tab })} ${maybeRenderHead()}<section class="max-w-screen-lg mx-auto"> ${data?.chat ? renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": async ($$result3) => renderTemplate` <p>
Subject:${" "} <strong class="text-slate-950">${data?.chat?.subject ?? ""}</strong> <br>
From:${" "} <strong class="text-slate-950"> ${data?.chat?.name ?? ""} | ${data?.chat?.email ?? ""} </strong> </p> <div class="whitespace-pre-wrap p-3 rounded border border-blue-900/5 max-h-[40rem] overflow-y-auto"> ${data?.chat?.message ?? ""} </div> ${renderComponent($$result3, "ReplyForm", null, { ...data?.chat, "slug": slug, "client:only": "solid-js", "client:component-hydration": "only", "client:component-path": "@components/ReplyForm", "client:component-export": "ReplyForm" })} <div> ${data?.chat?.replies?.map((reply) => renderTemplate`<div class="whitespace-pre-wrap p-3 rounded border border-blue-900/5 max-h-[40rem] overflow-y-auto"> ${reply?.reply ?? ""} </div>`)} </div> ` })}` : renderTemplate`<h1 class="min-h-[50vh] h-full text-center font-semibold text-2xl leading-tight flex items-center justify-center">
Message Not Found
</h1>`} </section> ` })}`;
}, "C:/projects/sambekiel_front/src/pages/dashboard/messages/[slug]-msg-[id].astro", void 0);

const $$file = "C:/projects/sambekiel_front/src/pages/dashboard/messages/[slug]-msg-[id].astro";
const $$url = "/dashboard/messages/[slug]-msg-[id]";

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

const page = () => _page;

export { page };
