import { jsxs as m, jsx as e } from "react/jsx-runtime";
import { Container as p, Segment as u, Grid as s } from "semantic-ui-react";
import { PageProvider as g, PageConsumer as y, PostIntro as f } from "@devgateway/wp-react-lib";
import { injectIntl as I } from "react-intl";
const P = ({ pages: r, columns: o }) => {
  const t = r ? r.sort((l, a) => l.menu_order - a.menu_order) : [], i = t.length / parseInt(o) + (t.length % parseInt(o) > 0 ? 1 : 0);
  let n = -1;
  return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(s, { columns: o, children: [...Array(parseInt(i)).keys()].map((l, a) => /* @__PURE__ */ e(s.Row, { children: [...Array(parseInt(o)).keys()].map((c, d) => (n++, /* @__PURE__ */ e(s.Column, { children: /* @__PURE__ */ e(f, { as: "div", post: t[n] }) }, d))) }, a)) }) });
}, x = (r) => {
  const {
    "data-height": o,
    "data-style": t,
    "data-columns": i,
    "data-parent": n,
    editing: l,
    component: a,
    unique: c,
    intl: { locale: d }
  } = r, h = { style: t, columns: i };
  return /* @__PURE__ */ m(p, { fluid: !0, className: `viz dashboard gallery ${t}`, children: [
    n && /* @__PURE__ */ e(
      g,
      {
        locale: d,
        parent: n,
        store: "gallery_" + r.parent + "_" + r.unique,
        perPage: 100,
        children: /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(P, { ...h }) })
      }
    ),
    !n && /* @__PURE__ */ e(u, { color: "red", children: "No child pages here" })
  ] });
}, b = I(x);
export {
  b as default
};
