"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const React = require("react");
const Tabs = require("../components/Tabs.js");
const Sidebar = require("./Sidebar.js");
const SideNav = require("./SideNav.js");
const Content = require("./Content.js");
const PageTile = require("./PageTile.js");
const toast = require("react-hot-toast");
const useAppState = require("../lib/useAppState.js");
const emotionReactJsxRuntime_browser_esm = require("../node_modules/.pnpm/@emotion_react@11.10.4_q4mq7tnhdumujvomvw24zx33y4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");
const Layout = ({
  pageHeader,
  content,
  secondarContent,
  sidebar,
  nav,
  header,
  top,
  bottomBar,
  panelled = false,
  extendedBorder = false,
  centeredContent = false,
  emptyPrompt,
  tabs,
  restrictWidth,
  children
}) => {
  const {
    Link,
    NavLink
  } = useAppState.useAppState();
  React.useState(false);
  return /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(React.Fragment, {
    children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
      className: "relative w-full h-screen overflow-hidden bg-slate-100",
      children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsxs("div", {
        className: "flex flex-1 grow",
        children: [sidebar ? /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
          className: "sticky w-64 bg-white",
          children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(Sidebar.Sidebar, {
            data: sidebar
          })
        }) : "", nav && nav.type === "nav" ? /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
          className: "sticky w-64 p-6 ease-in-out border-r",
          children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(SideNav.SideNav, {
            ...nav
          })
        }) : "", /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsxs("div", {
          className: "flex-col flex-1",
          children: [top && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            className: "",
            children: top
          }), pageHeader && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(PageTile.PageTile, {
            ...pageHeader,
            Link
          }), secondarContent && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            className: "",
            children: secondarContent
          }), tabs && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            className: "",
            children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(Tabs.Tabs, {
              ...tabs
            })
          }), children, emptyPrompt ? /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsxs("div", {
            className: "",
            children: [/* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
              className: "",
              children: "\u6CA1\u6709\u5185\u5BB9"
            }), /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
              className: "",
              children: "\u7A7A\u7A7A\u5982\u4E5F\uFF01"
            })]
          }) : /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            className: "",
            children: content && typeof content === "object" ? /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(Content.PageContent, {
              ...content
            }) : content
          }), bottomBar && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            children: bottomBar
          }), /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(toast.Toaster, {
            position: "top-center",
            reverseOrder: false
          })]
        })]
      })
    })
  });
};
exports.Layout = Layout;
//# sourceMappingURL=Layout.js.map
