import { jsx as o } from "@emotion/react/jsx-runtime";
import { AreaGridLayout as n } from "../AreaGridLayout/AreaGridLayout.js";
import { AreaPanels as c } from "./subcomponents/AreaPanels/AreaPanels.js";
import { useAreasStore as s } from "../../../../../../hooks/useAreas/index.js";
import { LoadingError as l } from "../../../../../../../LoadingError/LoadingError.js";
import { BaseAreaStyled as p } from "../../../../slots/AreasViewerSlots.js";
import { shallow as f } from "zustand/shallow";
const w = (i) => {
  const { areaId: r, selected: m, size: a } = i, t = s((e) => e.hashAreas[r].status), d = s(
    (e) => r ? e.hashAreas[r]?.maximizedId : void 0,
    f
  );
  return /* @__PURE__ */ o(p, { ownerState: { maximizedId: d }, children: t === "loaded" ? /* @__PURE__ */ o(c, { areaId: r, selected: m, size: a, children: /* @__PURE__ */ o(n, { areaId: r, size: a }) }) : /* @__PURE__ */ o(l, { status: t, action: () => {
  } }) });
};
export {
  w as BaseArea
};
