import { connect } from "react-redux";

import { IUser } from "../models/user";

import Application from "../components/app";

import { setAuthenticated, setUser } from "../actions";

const mapStateToProps = state => {
    return {
        authenticated: state.authenticated,
    };
};
const mapDispatchToProps = dispatch => {
    return {
        setAuthenticated: (status: boolean) => dispatch(setAuthenticated(status)),
        setUser: (user: IUser) => dispatch(setUser(user)),
    };
};

const ApplicationContainer = connect(mapStateToProps,
    mapDispatchToProps)(Application);

export default ApplicationContainer;
