import { jsx as e } from "react/jsx-runtime";
import { useState as t, useEffect as g, Suspense as _, lazy as w } from "react";
import { execute as u } from "@/common/services/QueryBuilder";
import { Box as r, CircularProgress as o } from "@mui/material";
const C = w(() => import("./TableList-B9hr05Hs-BIsMbnIV.js")), I = async () => (await u({
  code: "retrieve_synced_tables"
})).data, j = async () => (await u({
  code: "retrieve_all_tables_and_columns"
})).data;
function T() {
  const [c, m] = t([]), [d, f] = t([]), [h, p] = t([]), [b, x] = t([]), [n, y] = t(!1), [v, i] = t(!0);
  return g(() => {
    (async () => {
      i(!0);
      const l = await I();
      m(l == null ? void 0 : l.result.map((s) => s.tableName)), l != null && l.result && f(l.result);
      const a = await j();
      p(a == null ? void 0 : a.result.map((s) => s.tableName)), a != null && a.result && x(a.result), i(!1);
    })();
  }, [n]), /* @__PURE__ */ e(
    r,
    {
      sx: {
        width: "100%",
        minHeight: "85vh"
      },
      children: /* @__PURE__ */ e(
        _,
        {
          fallback: /* @__PURE__ */ e(r, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "60vh" }, children: /* @__PURE__ */ e(o, {}) }),
          children: v ? /* @__PURE__ */ e(r, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "60vh" }, children: /* @__PURE__ */ e(o, {}) }) : /* @__PURE__ */ e(
            C,
            {
              tableList: c,
              tablesInfo: d,
              allTableList: h,
              allTablesInfo: b,
              formSubmitted: n,
              reloadComponents: y
            }
          )
        }
      )
    }
  );
}
export {
  T as default
};
//# sourceMappingURL=EntityManagement-D-x6Qzal-BE01iKNR.js.map
