import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { Provider as ReduxProvider } from "react-redux";
import { Provider } from "./components/ui/provider";
import GlobalStateProvider from "./Contexts/GlobalStateProvider";
import "./index.css";
import { Theme } from "@chakra-ui/react";
import { store } from "./Redux/Store";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <ReduxProvider store={store}>
      {" "}
      {/* ✅ Wrap with Redux Provider */}
      <GlobalStateProvider>
        <Provider>
          {" "}
          {/* ✅ Wrap with Provider */}
          <Theme appearance="light">
            <App />
          </Theme>
        </Provider>
      </GlobalStateProvider>
    </ReduxProvider>
  </React.StrictMode>
);
