import { Routes, Route } from "react-router-dom";
import { ProvideSettings } from "./context/settings";
// import Snowfall from "react-snowfall";
import { SnowOverlay } from 'react-snow-overlay';
import { ToastContainer } from "react-toastify";
import { SocketContext, socket } from "./context/socket";
import StatsPage from "./pages/StatsPage";
import App from "./App";

export const STATS_URL = '/stats';

export default function AppRoutes() {
    return (
        <Routes>
            <Route path={STATS_URL} element={<StatsPage />} />
            <Route path="/" element={
                <ProvideSettings>
                    <SocketContext.Provider value={socket}>
                        <>
                            {/* <Snowfall style={{
                                zIndex: 2,
                                position: 'fixed',
                                width: '100vw',
                                height: '100vh'
                            }} /> */}
                            <SnowOverlay color={'rgba(240, 240, 240, 0.9)'} disabledOnSingleCpuDevices={true} />
                            <App />
                        </>
                        <ToastContainer />
                    </SocketContext.Provider>
                </ProvideSettings>
            } />
        </Routes>
    );
}