import ReactDOM from "react-dom";
import App from "./App";
import "./style/App.css";
import { AuthProvider } from "./context/AuthProvider";
import { Provider } from "react-redux";
import { store } from "./redux/store";
import { fetchFavorites } from "./redux/slices/favoritesSlice";
import { fetchMeetings } from "./redux/slices/meetingsAndUserStatusSlice";
import { fetchUsers } from "./redux/slices/usersSlice";

store.dispatch(fetchMeetings(""));
store.dispatch(fetchUsers(""));
store.dispatch(fetchFavorites(""));

const Index: React.FC = () => {
  return (
    <AuthProvider>
      <Provider store={store}>
        <App />
      </Provider>
    </AuthProvider>
  );
};

ReactDOM.render(<Index />, document.getElementById("root"));
