/* 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 $$Card } from '../../chunks/Card_CIZXu6HZ.mjs';
import { $ as $$PaginationTab } from '../../chunks/PaginationTab_CeD0cUyT.mjs';
import { e as getAllUsers } from '../../chunks/auths_D_cJY4N0.mjs';
import { $ as $$Layout, s as slugify } from '../../chunks/Layout_v67TeP9G.mjs';
/* empty css                                    */
export { renderers } from '../../renderers.mjs';

const $$Astro = createAstro("https://new.sambekiel.com");
const $$Index = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$Index;
  const { searchParams } = Astro2.url;
  const getAll = async (pageNo2 = 1) => {
    try {
      return await getAllUsers(pageNo2);
    } catch (error) {
      console.log(error);
    }
  };
  const page = searchParams.get("page");
  const pageNo = Number(page) >= 1 && Number(page).toString().toLowerCase() !== "nan" ? Number(page) : 1;
  const data = await getAll(pageNo);
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Staffs", "data-astro-cid-sxlv4meg": true }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<div class="summary-cards" data-astro-cid-sxlv4meg> ${renderComponent($$result2, "Card", $$Card, { "title": "Total Staffs", "body": `${data?.total ?? ""}`, "className": "bg-blue-700 hover:bg-blue-950 transition-all duration-300 cursor-none text-white rounded-2xl", "data-astro-cid-sxlv4meg": true })} </div> <section class="staffs-cards my-[2rem]" data-astro-cid-sxlv4meg> ${data?.users?.map((user) => {
    const fullname = `${user.firstName} ${user.lastName}`;
    return renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "data-astro-cid-sxlv4meg": true }, { "default": async ($$result3) => renderTemplate` ${renderComponent($$result3, "Card", $$Card, { "className": "border-blue-900/5 border rounded-lg h-full hover:shadow-md bg-white", "title": fullname, "lines": 3, "href": `/dashboard/staffs/${slugify(fullname)}-staff-${user.id}`, "data-astro-cid-sxlv4meg": true }, { "default": async ($$result4) => renderTemplate` <div class="capitalize" data-astro-cid-sxlv4meg>position: ${user.position}</div> <div class="" data-astro-cid-sxlv4meg>Email: ${user.email}</div> ` })} ` })}`;
  })} </section> ${renderComponent($$result2, "PaginationTab", $$PaginationTab, { "total_pages": data?.total_pages ?? 0, "data-astro-cid-sxlv4meg": true })} ` })} `;
}, "C:/projects/sambekiel_front/src/pages/dashboard/staffs/index.astro", void 0);

const $$file = "C:/projects/sambekiel_front/src/pages/dashboard/staffs/index.astro";
const $$url = "/dashboard/staffs";

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

const page = () => _page;

export { page };
