import { jsxs, Fragment, jsx } from "react/jsx-runtime";
import { B as Button } from "./button-CdJZJLGw.js";
import { C as Card } from "./card-B-gBwpxd.js";
import { D as DashboardLayout } from "./layout-Cf9mPjOS.js";
import { Head, Link } from "@inertiajs/react";
import { Plus, Award } from "lucide-react";
import CertificateCard from "./certificate-card-Di3USuN2.js";
import "react";
import "@radix-ui/react-slot";
import "class-variance-authority";
import "./utils-DLCPGU0v.js";
import "clsx";
import "tailwind-merge";
import "./sidebar-C1tqSfnl.js";
import "./separator-CSqU-rrB.js";
import "@radix-ui/react-separator";
import "./sheet-BOQ-e9_C.js";
import "@radix-ui/react-dialog";
import "./tooltip-BYKuzaoQ.js";
import "@radix-ui/react-tooltip";
import "./main-BKBelQb-.js";
import "next-themes";
import "sonner";
import "./appearance-BJIqrZL5.js";
import "./dropdown-menu-msun3TP8.js";
import "@radix-ui/react-dropdown-menu";
import "./language-mewnB-2r.js";
import "./notification-Bg6IzWOo.js";
import "./popover-Cv6Hz_y0.js";
import "@radix-ui/react-popover";
import "date-fns";
import "./scroll-area-CDdrLubh.js";
import "@radix-ui/react-scroll-area";
import "./app-logo-DWyi5bLn.js";
import "./accordion-cIAfVfPq.js";
import "@radix-ui/react-accordion";
import "./route-DlE7FdTW.js";
import "./avatar-C8iCpF5R.js";
import "@radix-ui/react-avatar";
import "./use-lang-44ndmTOc.js";
import "./dialog-DGP_3dPQ.js";
import "./certificate-preview-qrVQ0C-Z.js";
const CertificateIndex = ({ templates }) => {
  const examTemplates = templates.filter((template) => template.type === "exam");
  const courseTemplates = templates.filter((template) => template.type === "course");
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsx(Head, { title: "Certificate Templates" }),
    /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: "Certificate Templates" }),
          /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Manage your certificate templates for course completion" })
        ] }),
        /* @__PURE__ */ jsx(Link, { href: route("certificate.templates.create"), children: /* @__PURE__ */ jsxs(Button, { children: [
          /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
          "Create Template"
        ] }) })
      ] }),
      /* @__PURE__ */ jsxs("div", { className: "py-6", children: [
        /* @__PURE__ */ jsx("h6", { className: "mb-3 text-xl font-semibold", children: "Course Certificate Templates" }),
        courseTemplates.length === 0 ? /* @__PURE__ */ jsx(Card, { className: "p-12", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center text-center", children: [
          /* @__PURE__ */ jsx(Award, { className: "text-muted-foreground mb-4 h-16 w-16" }),
          /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-semibold", children: "No certificate templates yet" }),
          /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: "Create your first certificate template to get started" }),
          /* @__PURE__ */ jsx(Link, { href: route("certificate.templates.create"), children: /* @__PURE__ */ jsxs(Button, { children: [
            /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
            "Create Your First Template"
          ] }) })
        ] }) }) : /* @__PURE__ */ jsx("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-3", children: courseTemplates.map((template) => /* @__PURE__ */ jsx(CertificateCard, { type: "course", template }, template.id)) })
      ] }),
      /* @__PURE__ */ jsxs("div", { className: "py-6", children: [
        /* @__PURE__ */ jsx("h6", { className: "mb-3 text-xl font-semibold", children: "Exam Certificate Templates" }),
        examTemplates.length === 0 ? /* @__PURE__ */ jsx(Card, { className: "p-12", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center text-center", children: [
          /* @__PURE__ */ jsx(Award, { className: "text-muted-foreground mb-4 h-16 w-16" }),
          /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-semibold", children: "No certificate templates yet" }),
          /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: "Create your first certificate template to get started" }),
          /* @__PURE__ */ jsx(Link, { href: route("certificate.templates.create"), children: /* @__PURE__ */ jsxs(Button, { children: [
            /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
            "Create Your First Template"
          ] }) })
        ] }) }) : /* @__PURE__ */ jsx("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-3", children: examTemplates.map((template) => /* @__PURE__ */ jsx(CertificateCard, { type: "exam", template }, template.id)) })
      ] })
    ] })
  ] });
};
CertificateIndex.layout = (page) => /* @__PURE__ */ jsx(DashboardLayout, { children: page });
export {
  CertificateIndex as default
};
