import React from "react";
import "./App.css";
import Header from "./Header/header";
import Navigation from "./Content/Navigation/navigation";
import News from "./Content/News/news";
import { Redirect, Route, BrowserRouter as Router, Switch } from "react-router-dom";
import Music from "./Content/Music/music";
import Profile from "./Content/Profile/profile";
import Settings from "./Content/Settings/settings";
import Login from "./Content/Login/Login";
import Registration from "./Content/Registration/Registration";
import Users from "./Content/Users/users";
import Messages from "./Content/Messages/messages";
import Page404 from "./Components/404_Page/404_Page";
import { store } from "./Redux/promise_reducer";
import { Provider } from "react-redux";
import history from "./history";

function fff(a) {
    console.log(a)
    return <div>Пусто</div>
}

function App() {
    return (
        <Provider store={store}>
        <Router history={history}>
        <div className="app-wrapper">
            <Header />

            <div className="content-block">
                <Navigation />

                <div className="app-wrapper-content">
                    <Switch>
                    <Redirect exact from="/" to="/profile" />
                    <Route
                        path="/profile" 
                        render={() => <Profile />}
                    />
                    <Route
                        path="/messages"
                        render={() => <Messages />}
                    />
                    <Route
                        path="/users"
                        render={() => <Users /> }
                    />
                    <Route
                        path="/404"
                        render={() => <Page404 /> }
                    />
                    <Route path="/news" component={News} />
                    <Route path="/music" component={Music} />
                    <Route path="/settings" component={Settings} />
                    <Route path="/login" component={Login} />
                    <Route path="/registration" component={Registration} />
                    <Route component={fff} />
                    </Switch>
                </div>
            </div>
        </div>
        </Router>
    </Provider>
    );
}

export default App;
