const { render } = wp.element;
import App from "./onboard-app/App";
import "@preact/signals-react/auto";
import LiveApp from "./live-app/LiveApp";
import MioCommerceNavigation from "./miocommerce-layout/MioCommerceNavigation";

if (document.getElementById("wb-react-app")) {
  const isLiveWebsite = window.live_app_data?.is_live_website;
  console.log(" live_app_data", window.live_app_data);
  if (isLiveWebsite === "true") {
    render(
      <MioCommerceNavigation>
        <LiveApp />
      </MioCommerceNavigation>,
      document.getElementById("wb-react-app")
    );
  } else {
    render(
      <MioCommerceNavigation>
        <App />
      </MioCommerceNavigation>,
      document.getElementById("wb-react-app")
    );
  }
}
