import { jsxs as s, jsx as a } from "react/jsx-runtime";
import { gF as i, gC as g, f_ as p, cQ as h, I as u, dd as f, cA as x, dI as m, ac as y } from "./index-a1tACKHw.js";
const T = {
  BUMP: "bump",
  CHORE: "chore",
  CI: "ci",
  DOCS: "docs",
  FEATURE: "feature",
  FIX: "fix",
  REFACTOR: "refactor",
  TEST: "test"
}, N = ({ customItems: o }) => {
  const { t: l } = i(), { lang: c, t: d } = g(), { changelog: t, isLoading: r, filters: n } = p();
  return /* @__PURE__ */ s(
    h,
    {
      description: l("all_changelog_info"),
      header: /* @__PURE__ */ s("nav", { className: "grid md:grid-cols-2 gap-2 pt-4 items-center", children: [
        /* @__PURE__ */ a(
          x,
          {
            label: l("filter_by_type"),
            onChange: (e) => n.setType(e),
            options: m.map((e) => e),
            size: "small",
            value: n.type
          }
        ),
        /* @__PURE__ */ a(
          y,
          {
            label: l("search"),
            onChange: n.setQuery,
            size: "sm",
            value: n.query ?? ""
          }
        )
      ] }),
      loading: r,
      title: l("changelog"),
      children: [
        t.length === 0 && !r && /* @__PURE__ */ s("div", { className: "py-8 text-center text-foreground/70 flex flex-col items-center gap-2", children: [
          /* @__PURE__ */ a(u, { name: "alertTriangle", size: 32 }),
          l("no_changelog_found")
        ] }),
        /* @__PURE__ */ s("ul", { className: "overflow-y-auto h-full flex flex-col md:gap-2", children: [
          t.map((e) => /* @__PURE__ */ a(
            f,
            {
              heading: /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
                /* @__PURE__ */ a("span", { className: "text-sm", children: `${e.module ? d(e.module) : l("unknown")} - ${e.author.username}` }),
                /* @__PURE__ */ s("div", { className: "text-foreground/70 text-xs flex gap-1 divide-x divide-foreground/20", children: [
                  /* @__PURE__ */ a("span", { className: "pr-1", children: l(T[e.type]) }),
                  /* @__PURE__ */ a("span", { children: new Date(e.committer.date).toLocaleDateString(c.locale) })
                ] })
              ] }),
              children: /* @__PURE__ */ s("div", { className: "flex gap-2 flex-col", children: [
                /* @__PURE__ */ a("span", { className: "line-clamp-3", children: e.title }),
                /* @__PURE__ */ a("span", { className: "line-clamp-6 text-foreground/80 text-xs", children: e.body })
              ] })
            },
            e.sha + e.committer.date
          )),
          o
        ] })
      ]
    }
  );
};
export {
  N as default
};
