"use client";
import { j as t } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { Popover as j } from "@mantine/core";
import { useDisclosure as g } from "@mantine/hooks";
import n from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import r from "./MetaSection.module.scss.mjs";
const D = ({
  title: x,
  items: i,
  classNames: o,
  maxVisibleItems: d = 5,
  moreIndicator: v
}) => {
  const u = i.slice(0, d), h = i.length > d ? i.slice(d) : [], [f, { open: l, close: c }] = g(!1), I = () => v || /* @__PURE__ */ t.jsxs("div", { className: n(r.moreIndicator, o == null ? void 0 : o.moreIndicator), children: [
    "+",
    h.length
  ] });
  return /* @__PURE__ */ t.jsxs("div", { className: n(r.metaSection, o == null ? void 0 : o.root), children: [
    /* @__PURE__ */ t.jsx("h3", { className: n(r.title, o == null ? void 0 : o.title), children: x }),
    /* @__PURE__ */ t.jsxs("div", { className: n(r.itemsContainer, o == null ? void 0 : o.itemsContainer), children: [
      u.map(
        (e, p) => e ? /* @__PURE__ */ t.jsx("div", { className: r.item, children: e }, p) : null
      ),
      h.length > 0 && /* @__PURE__ */ t.jsxs(
        j,
        {
          position: "bottom",
          shadow: "md",
          opened: f,
          classNames: {
            dropdown: n(r.popover, o == null ? void 0 : o.popover)
          },
          children: [
            /* @__PURE__ */ t.jsx(j.Target, { children: /* @__PURE__ */ t.jsx(
              "div",
              {
                onMouseEnter: l,
                onMouseLeave: c,
                className: n(r.item, r.lastItem),
                children: I()
              }
            ) }),
            /* @__PURE__ */ t.jsx(j.Dropdown, { children: /* @__PURE__ */ t.jsx(
              "div",
              {
                className: n(
                  r.hiddenItemsList,
                  o == null ? void 0 : o.hiddenItemsList
                ),
                children: h.map((e, p) => /* @__PURE__ */ t.jsx("div", { className: r.hiddenItem, children: e }, p))
              }
            ) })
          ]
        }
      )
    ] })
  ] });
};
export {
  D as default
};
//# sourceMappingURL=index.mjs.map
