import { jsx as r } from "react/jsx-runtime";
import m from "../ResponsiveContainer.js";
import { PostProvider as w, PostConsumer as v, Post as P } from "@devgateway/wp-react-lib";
import { useLocation as d, useParams as h } from "react-router";
const g = (t) => {
  const { header: s, footer: n } = t, i = d(), e = h(), o = new URLSearchParams(i.search), a = o.get("preview"), p = e.type == "post" ? "posts" : e.type, c = o.get("_wpnonce");
  return /* @__PURE__ */ r(m, { header: s, footer: n, children: /* @__PURE__ */ r(
    w,
    {
      type: p,
      store: "preview",
      perPage: 1,
      view: a,
      locale: e.lan,
      previewNonce: c,
      previewId: e.id,
      children: /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(P, { preview: !0, showIntro: !0 }) })
    }
  ) });
};
export {
  g as default
};
