import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { Provider } from "react-redux";
import store from "./redux/store";
import { Slide, ToastContainer } from "react-toastify";
import { BrowserRouter as Router } from "react-router-dom";
import { CookiesProvider } from "react-cookie";

const root = ReactDOM.createRoot(
	document.getElementById("root") as HTMLElement
);

root.render(
	<React.StrictMode>
		<CookiesProvider defaultSetOptions={{ path: "/" }}>
			<Provider store={store}>
				<Router>
					<App />
				</Router>
				<ToastContainer
					autoClose={2000}
					hideProgressBar
					theme="dark"
					transition={Slide}
					toastStyle={{ border: "1px solid dimgray" }}
				/>
			</Provider>
		</CookiesProvider>
	</React.StrictMode>
);
