// Fonctionnalités 
import React from "react";
import Home from "./page/Home";
import Login from "./auth/Login";
import { AuthProvider } from "./auth/backend/Auth";
import PrivateRoute from "./utils/PrivateRoute";
import Server from "./server/Server";
import NotFound from './utils/NotFound';
import InServer from './server/components/server/InServer'
import InChannel from './server/components/channel/show/InChannel'
import Register from './auth/Register'
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";

const App = () => {
  return (
    <AuthProvider>
      <Router>

        <div>
          <Switch>
            <Route exact path="/" component={Home} />
            <Route exact path="/login" component={Login} />
            <Route exact path="/register" component={Register} />
            <Route exact path="/server/:id" component={InServer} />
            <Route exact path="/server/channel/:id" component={InChannel} />
            <PrivateRoute exact path="/home" component={Server} />
            <Route component={NotFound} />
          </Switch>
        </div>
      </Router>
    </AuthProvider>
  );
};

export default App;
